-
I had a line of code with conneciton info to a DB hard-coded
i.e.
connection.connectstring = "DSN=DSNName;Username=USERNAME;Password=PASSWORD"
What I am trying to do is have it take the DSNNAME, USERNAME, and PASSWORD from defined variables, but it does not like the syntax. I think it looked like
blah.connectstring = "DSN=" &DSNName &";Username=" & etc...
Any idea?
-
This is what you need
Code:
objConn.ConnectionString = "DSN=" & DSNName & ";" _
& "UID=" & UserName & ";" _
& "PWD=" & Password
objConn.Open