janu_s
asked on
Runtime error '-2147217843 (80040e4d)'
I created an ODBC driver for SQl server using the sa login for authentication , and tested successfully . But when my vb code tries to access the filedsn I created it gives me an error , saying Runtime error '-2147217843 (80040e4d)', [Microsoft][ODBC SQL Server Driver][SQL Server]Login ailed for user 'sa'.
What went wrong here?
What went wrong here?
Post the VB code.
yes, paste the code
ASKER
The following is code I wrote in Visual Basic :
Set SDEAdocon = New ADODB.Connection
SDEAdocon.Open "filedsn=r:\GNIS_Ext\gnis2 001"
The code does not give error when I create the ODBC using WindowsNT authentication but gives error when I create using the sa login.
Set SDEAdocon = New ADODB.Connection
SDEAdocon.Open "filedsn=r:\GNIS_Ext\gnis2
The code does not give error when I create the ODBC using WindowsNT authentication but gives error when I create using the sa login.
If that is the case, the only thing I can think of is that the password for sa is incorrect in the dsn file.
Change this line:
SDEAdocon.Open "filedsn=r:\GNIS_Ext\gnis2 001"
To:
SDEAdocon.Open "filedsn=r:\GNIS_Ext\gnis2 001;" & _
"Uid=yourusernamegoeshere; " & _
"Pwd=yourpasswordgoeshere"
Anthony
SDEAdocon.Open "filedsn=r:\GNIS_Ext\gnis2
To:
SDEAdocon.Open "filedsn=r:\GNIS_Ext\gnis2
"Uid=yourusernamegoeshere;
"Pwd=yourpasswordgoeshere"
Anthony
ASKER
But when I test the connection during the creation of ODBC , it tests sucessfully.Which means the password is correct.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Why didnt I think about that earlier!!.Thanks.
You are welcome.
Anthony
Anthony
You should have accepted acperkins's comment. acperkins gave the answer. I only explained it.