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
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