Linking to an SQL Server DB using SQL Server security

J

Jonathan Crawford

Hi,
I have normally used windows security to link to SQL Server databases
and have a routine which relinks all the tables based on a connnection
string.
This allows me to swap between live, back up and developement databases
very easily

I have a SQL db which uses SQL security and I can run my routine
using a connection string
ODBC;DSN=MYDSN;UID=MYUSID;PWD=MYPASSWORD;
and the code
strAttachedTableName = rs1("tblnameSQL")
strLocalTableName = rs1("tblnameLocal")
Set db = CurrentDb
Set TD = db.CreateTableDef(strLocalTableName)
TD.Connect = GetConnectString
TD.SourceTableName = strAttachedTableName
db.TableDefs.Append TD

and it works fine linking the tables

The problem is that it does not persist, so the next time I open the
access database it asks me for the password for each table.

If I link normally (file, menu, getexternal data) and click the save
password box, then it persists.
Is there a way to get it to persist when connewcting through vb

thanks

jonathan
 

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