G
Guest
I'm having trouble connecting to SQL server using a dsn-less connection. I have used to code before, and have experienced no problems before, but now when I run the code, it connects to the SQL server. However, if I come out of the access database, and go back in, it attempts to connect to these tables using a trusted connection. This is causing a dialogue box to appear, when I attempt to run a query against the SQL tables
The code I use to connect is as follows
MyTableDef.Connect = "ODBC;APP=Microsoft® Access;DRIVER={SQL SERVER};SERVER=" & gSQLserver & ";UID=" & gSQLuid & ";PWD=" & gSQLpwd & ";DATABASE=" & gSQLdb & ";TABLE=dbo." & SQLTableName & ";DSN=''
all of the parameters that are required have been set, and it would surely fail to connect to the SQL server if the info in here was incorrect the first time round
Any ideas??
The code I use to connect is as follows
MyTableDef.Connect = "ODBC;APP=Microsoft® Access;DRIVER={SQL SERVER};SERVER=" & gSQLserver & ";UID=" & gSQLuid & ";PWD=" & gSQLpwd & ";DATABASE=" & gSQLdb & ";TABLE=dbo." & SQLTableName & ";DSN=''
all of the parameters that are required have been set, and it would surely fail to connect to the SQL server if the info in here was incorrect the first time round
Any ideas??