I have written an Access 2000 applicatiion for my client. In this database I use some DSNless tabledefs to link to a SQL Server. I have a piece of code that creates these TableDefs. My problem is that when I create one of these tabledefs, the credentials I place in the connect string are overwritten. Here's how I create the TableDef:
ConnectString = "ODBC;DRIVER=SQL Server;Server=192.168.16.2;" & _
Set MyTabledef = CurrentDb.CreateTableDef("MyTable", dbAttachSavePWD, "MyTable", ConnectString)
However, after this code has run, the Tabledef has this in the .Connect property:
ODBC;DRIVER=SQL Server;SERVER=192.168.16.2;UID=Ian;APP=Microsoft® Access;WSID=GANDALF;DATABASE=Merlin;Trusted_Connection=Yes
So without valid credentials in the .Connect property, non admin users are being denied access to the SQL Server. How do I fix this? Presumably there is something wrong in the Connect String I am supplying.