Reconnect to ODBC tables via code

S

sbowman

I have a few linked tables in SQL server that i'm connecting to, when
the report runs it pops the user up for the password. I'm trying to get
around that and I am using the following code:

Dim ConnectSTR As String

'opens ODBC connection
ConnectSTR = "Provider=MSDASQL;DSN=Magic
Production;Uid=reports;Pwd=Magic;"
Set Connection = New ADODB.Connection
With Connection
.ConnectionString = ConnectSTR
.ConnectionTimeout = 10
.Open
End With

it's still prompting me for the password...help!!

Thanks,
Shelley
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top