cyberbiker
Programmer
When I hardcode the connection string, everything appears fine. But when I try to read the connection string from an ini file, the ODBC connection fails.
The following code works:
Defaulttype = dbUseODBC
Set dbconnection = OpenConnection("", dbDriverNoPrompt, False, "ODBC;dsn=LocalServer;database=testa;uid=tah;pwd=;"""
when I attempt to use this code:
Defaulttype = dbUseODBC
set dbconnection = OpenConnection(bfGetODBCConnect())
The connection fails.
bfGetODBCConnect() returns the connection string from an ini file.
When I set a watch, bfGetODBCConnect returns what appears to be an identical string (including spaces):
"", dbDriverNoPrompt, False,
"ODBC;dsn=LocalServer;database=testa;uid=tah;pwd=;"""
Anybody have any ideas what I am doing wrong? Terry (cyberbiker)
The following code works:
Defaulttype = dbUseODBC
Set dbconnection = OpenConnection("", dbDriverNoPrompt, False, "ODBC;dsn=LocalServer;database=testa;uid=tah;pwd=;"""
when I attempt to use this code:
Defaulttype = dbUseODBC
set dbconnection = OpenConnection(bfGetODBCConnect())
The connection fails.
bfGetODBCConnect() returns the connection string from an ini file.
When I set a watch, bfGetODBCConnect returns what appears to be an identical string (including spaces):
"", dbDriverNoPrompt, False,
"ODBC;dsn=LocalServer;database=testa;uid=tah;pwd=;"""
Anybody have any ideas what I am doing wrong? Terry (cyberbiker)