Hello All,
Something very strange happened in my code.
The goal of my code is to connect two different databases on different servers.
The Connection String of a database is coming from a table in another database.
Therefore, what I did is something like:
Set Conn = CreateObject("ADODB.Connection"
ConnString = rs("ConnString"
Conn.Open ConnString
Then, I got the "Data Source Name not found....." error.
However, when I plug in the written ConnString instead of a variable in the Conn.Open part and it works.
What I stored in the ConnString is something like:
"DRIVER=Microsoft Access Driver (*.mdb);DBQ=\\servername\database.mdb"
It works if I put the whole string in the open connection command while I can't use the variable. WHY?
PLEASE HELP!
Thank you very much,
Beer
Something very strange happened in my code.
The goal of my code is to connect two different databases on different servers.
The Connection String of a database is coming from a table in another database.
Therefore, what I did is something like:
Set Conn = CreateObject("ADODB.Connection"
ConnString = rs("ConnString"
Conn.Open ConnString
Then, I got the "Data Source Name not found....." error.
However, when I plug in the written ConnString instead of a variable in the Conn.Open part and it works.
What I stored in the ConnString is something like:
"DRIVER=Microsoft Access Driver (*.mdb);DBQ=\\servername\database.mdb"
It works if I put the whole string in the open connection command while I can't use the variable. WHY?
PLEASE HELP!
Thank you very much,
Beer