H
hutteto
I am trying to programmatically set the userid (UID) and password
(PWD) in an existing ODBC DSN connection string. I am able to set the
UID but not the PWD. The CURRENT UID is TestID and there is no current
PWD specified. Here is the connection string as it is before I try to
change it:
"ODBC;DSN=SDW_PRD_ALLVM;UID=TestID;;DATABASE=SDW_PRD_ALLVM;"
I am setting the new connection string (TargetConString) from 4
different string variables using the following 2 lines of code...
(The first line builds the new connection string and the 2nd line sets
it. The UID of the new connection string should be "NEWID" and the
password should be "NEWPW")
TargetConString = "ODBC;DSN=" & TDDatabase & ";UID=" & UserName &
";PWD=" & PW & ";DATABASE=" & TDDatabase & ";"
TargetFile.Connections.Item(Counter).ODBCConnection.Connection =
TargetConString
However here is the result:
"ODBC;DSN=SDW_PRD_ALLVM;UID=NEWID;;DATABASE=SDW_PRD_ALLVM;"
It sets everything except the PWD where it is still showing a as
blank.
How do I fix this?
(PWD) in an existing ODBC DSN connection string. I am able to set the
UID but not the PWD. The CURRENT UID is TestID and there is no current
PWD specified. Here is the connection string as it is before I try to
change it:
"ODBC;DSN=SDW_PRD_ALLVM;UID=TestID;;DATABASE=SDW_PRD_ALLVM;"
I am setting the new connection string (TargetConString) from 4
different string variables using the following 2 lines of code...
(The first line builds the new connection string and the 2nd line sets
it. The UID of the new connection string should be "NEWID" and the
password should be "NEWPW")
TargetConString = "ODBC;DSN=" & TDDatabase & ";UID=" & UserName &
";PWD=" & PW & ";DATABASE=" & TDDatabase & ";"
TargetFile.Connections.Item(Counter).ODBCConnection.Connection =
TargetConString
However here is the result:
"ODBC;DSN=SDW_PRD_ALLVM;UID=NEWID;;DATABASE=SDW_PRD_ALLVM;"
It sets everything except the PWD where it is still showing a as
blank.
How do I fix this?