views:

145

answers:

3

Hello,

I am really stumped on this, I am not sure if someone can at least point me in the right direction?

I have an MS Access Reporting Application. It has a few local tables in it but predominantly relies on tables from a SQL Server 2005 database that it links to. It links to the SQL DB via a System DSN.

I have built a function that confirms the required tables are linked before any reports are run and that all works great. I have a stored Connection String for each time the system requires a connection to the SQL DB to refresh the linked tables. However, when the user FIRST runs the app, a SQL Authentication Dialog Box pops up asking the user for a Username and Password to the requested Database.

No matter what I do, I can't seem to suppress this. The System DSN is and must be set up for SQL Authentication, however if I could just suppress this initial dialog box, my code will take care of the Authentication moving forward.

Can ANYONE help me with this? I am stumped.

Thank you so much in advance for all suggestions!

Dallas

+1  A: 

Have you tried putting the SQL user name and password in the connection string?

User Id=myUsername;Password=myPassword;
dsteele
A: 

If any of your code is trying to access those tables (even a drop-down on a hidden form) prior to your table-checker running, it will try and authenticate.

Your verification code could itself be the culprit. Many try to verify by checking if they can retrieve records. Instead, verify that the connection string is as it should be in the schema definitions: CurrentDb.TableDefs("MyTable").Connect

Thomas G. Mayfield
+1  A: 

Uh, is there some important reason why you're using SQL authentication instead of Windows authentication? The latter makes it completely unnecessary to store any user information in your connect strings.

David-W-Fenton