• 0

[VB6] Code works in one app, not another


Question

Ok, here's a strange one. I am trying to debug a DLL on our new test server (let's not go into the fact that there was never a test server shall we?!!)

I am getting this error:

-2147467259 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

When the following code is run in the DLL

--------------------------------------------

Dim cn As New ADODB.Connection

strDSN = "DSN=Engine"

strUser = "username" 'not the real user name

strPassword = "password" 'that's not really the password, you know that right? ;)

'ERROR HAPPENS HERE!

cn.Open strDSN, strUser, strPassword

--------------------------------------------

The strange think is, if I copy this code into a new VB exe and run it, in runs fine. I have the ODBC setup (yes, the ADO is running through ODBC... I didnt write this!)

Any thoughts?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
I have not done ODBC for a long time but is there a DSN setup on the test server called "Engine"? and is it linked to a database?

Thansk for the response. I too haven't used ODBC in forever and a day (10+ years) since ADO does not need to use ODBC. However our current code uses it. (why? no one knows. Bad dev I'm sure)

It turns out the issue is when I setup our test server (10 years and this company didnt have one!!!!!) I used "User DSN" instead of "System DSN" so of course when *I* ran a sample app it would run, but SQL Server runs it's jobs as System.... DAYS went by as I tried to figure this b!t@h out.

Link to comment
Share on other sites

  • 0
Thansk for the response. I too haven't used ODBC in forever and a day (10+ years) since ADO does not need to use ODBC. However our current code uses it. (why? no one knows. Bad dev I'm sure)

It turns out the issue is when I setup our test server (10 years and this company didnt have one!!!!!) I used "User DSN" instead of "System DSN" so of course when *I* ran a sample app it would run, but SQL Server runs it's jobs as System.... DAYS went by as I tried to figure this b!t@h out.

mark,I also do not know

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.