Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC - Works in Design mode not in EXE

Status
Not open for further replies.

dja1

Programmer
Apr 24, 2002
65
GB
I have inherited an application written in VB6 that uses ODBC to communicate with an Oracle database.

In design mode, it works fine, but when I compile it, and try to execute the EXE version, when it connects to the database, it presents a typical ODBC logon screen, (database name / username / password).

When I enter a valid name and password, the error returned is "Application-defined or Object-defined error"

The connection string is;
ODBC;DSN=CCBSDEV;UID=XXXXXXXX;PWD=YYYYYYYY;LoginTimeout=90

I am compiling to, and executing from, the same directory in both instances.

Any help would be greatly appreciated.
 
Are you executing on the same computer using the same network credentials? I know you are specifying a UID and PWD, but the response could affect troubleshooting on this one.
 
Nagrom

Yes to both. I literally;
1) Test my App in VB, (no ODBC logon request shown)
2) Compile the App
3) Execute the App, (ODBC logon request shown)
All on the same computer, in the same session, without logging off.

Is it possible that a different DLL is being referenced if the App is being executed or linked to make an EXE?
 
Can you put the code here that actually makes the connection?
 
As follows;
Global Db As Database

Set Db = Workspaces(0).OpenDatabase("", False, False, strConnectString)

Then, at the "Set Db" line above;

debug.Print strconnectstring

With the following result, (with the password X'ed out);

ODBC;DSN=CCBSDEV;UID=COLLVB;PWD=xxxxxxxx;LoginTimeout=90
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top