Showing posts with label vb6. Show all posts
Showing posts with label vb6. Show all posts

Monday, March 12, 2012

error when connect to sqlserver from another machine

hi ..

i install sqlserver and make app with vb6 using ADO to connect to the database and successfully

i put that application on another pc on the network
when i open it it says "can't login computername\guest" ?!!

any help

thanks in advance.any answers|||Are both of your pcs on a domain or a workgroup? If it's not domain, you need to create a same account/password pair on both machines and use that account to login.|||thanks

Xinwei Hong for reply

the two machines on a workgroup so .. could you explain pcs under domain in few lines ?
now i will create two users on the two machines and tell you later

thanks in advance.
|||By "pcs under domain", I mean whether your PC is under a domain which is usually used in median/large company. In this case, domain controller will help you do a lot of things.|||thanks for reply

you says i can do a lot of things if i'm under domain like what ?and what is the domain controler ? could you explain ?

and if you have short time i can talk to you in messanger it will be kind from you

thanks|||i make 2 users with same name but ..
the same problem occurs ?|||It's hard to describe "domain controller" and related stuff in short words. I recommend you find some documents related to Windows Networks to read.

Are you sure your client is running under the user account you created and you used that account to login to the server? It means you may need to login the client Windows system and run your client app under that account. If you user Administrator or even logon the computer without a user/password, it won't work.|||is this means that i need a password for administrator user to login to the database server ?|||Not necessary. SQL server runs as a service under various account(e.g. network service, local system, administrator account, etc.).

Friday, February 24, 2012

Error trying to save a date field

Hi there, right now i'm working with a VB6 project that connects to a
SQLSERVER 2000.
I discovered a problem that, i hope you can help me.
The problem is that, when i try to save a record with a date field - the
date saved in database is 2 days more that the typed date. ALWAYS 2 DAYS!!!
Don't know why.
In order to save a record to DB i try to use val = cdec(val), where val is a
date value, and for strings values i just use val = "'" & val & "'", and so
on... for diferent types of fields.
Because i'm developing for a spanish environment i decided to convert dates
in the right format ("dd/mm/yyyy") and try to have regional settings that
match national language and location.
If anybody can help me, please i will appreciate it.
Felix.You probably represent the date as some umber datatype (float, int or so) an
d the VB "base date"
differs from the SQL Server "base date" by 2 days. Never use numbers to repr
esent datetime in SQL,
represent them as strings. Or better yet, use a date datatype in your host l
anguage and use
parametized queries. Read here about datetime datatype in SQL Server:
http://www.karaszi.com/SQLServer/info_datetime.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Felix Quevedo C." <FelixQuevedoC@.discussions.microsoft.com> wrote in messag
e
news:3FBFD807-414F-4846-9DCE-A90AAFF1CB95@.microsoft.com...
> Hi there, right now i'm working with a VB6 project that connects to a
> SQLSERVER 2000.
> I discovered a problem that, i hope you can help me.
> The problem is that, when i try to save a record with a date field - the
> date saved in database is 2 days more that the typed date. ALWAYS 2 DAYS!!
!
> Don't know why.
> In order to save a record to DB i try to use val = cdec(val), where val is
a
> date value, and for strings values i just use val = "'" & val & "'", and s
o
> on... for diferent types of fields.
> Because i'm developing for a spanish environment i decided to convert date
s
> in the right format ("dd/mm/yyyy") and try to have regional settings that
> match national language and location.
> If anybody can help me, please i will appreciate it.
> Felix.|||Sounds like VB is converting the date to an integer and back again, and
using its own base date (1899-12-30) instead of SQL Server's (1900-01-01).
Try taking the literal string and passing it as a string. If you do this,
be sure to type in a proper format, e.g. YYYYMMDD. If you type in
mm/dd/yyyy there are several points along the way where this can easily
convert to dd/mm/yyyy.
A
"Felix Quevedo C." <FelixQuevedoC@.discussions.microsoft.com> wrote in
message news:3FBFD807-414F-4846-9DCE-A90AAFF1CB95@.microsoft.com...
> Hi there, right now i'm working with a VB6 project that connects to a
> SQLSERVER 2000.
> I discovered a problem that, i hope you can help me.
> The problem is that, when i try to save a record with a date field - the
> date saved in database is 2 days more that the typed date. ALWAYS 2
> DAYS!!!
> Don't know why.
> In order to save a record to DB i try to use val = cdec(val), where val is
> a
> date value, and for strings values i just use val = "'" & val & "'", and
> so
> on... for diferent types of fields.
> Because i'm developing for a spanish environment i decided to convert
> dates
> in the right format ("dd/mm/yyyy") and try to have regional settings that
> match national language and location.
> If anybody can help me, please i will appreciate it.
> Felix.|||thanks a lot Tibor. My problem is solved - Felix.
"Tibor Karaszi" wrote:

> You probably represent the date as some umber datatype (float, int or so)
and the VB "base date"
> differs from the SQL Server "base date" by 2 days. Never use numbers to re
present datetime in SQL,
> represent them as strings. Or better yet, use a date datatype in your host
language and use
> parametized queries. Read here about datetime datatype in SQL Server:
> http://www.karaszi.com/SQLServer/info_datetime.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Felix Quevedo C." <FelixQuevedoC@.discussions.microsoft.com> wrote in mess
age
> news:3FBFD807-414F-4846-9DCE-A90AAFF1CB95@.microsoft.com...
>