all groups > sql server odbc > january 2004 >
You're in the

sql server odbc

group:

Access app to SQL Server - Login failed for user '(null)'. Reason: Not associated...


Access app to SQL Server - Login failed for user '(null)'. Reason: Not associated... JRE
1/26/2004 9:29:31 AM
sql server odbc:
I have an Access 2000 application that connects to a mixed mode SQL Server
2000 database. I connect via a SQL autentication DSN and a co-developer
connects via a Windows autentication DSN. We both connected fine until my
co-developer copied the Access application to make changes. Now it seems
that the application "assumes" a Windows ODBC authentication connection and
ignores my SQL DSN authentication when I open the application. I get the
following error message (and am prompted with a login message box) for each
table.

The error is:

Connection failed:
SQLState: '28000'
SQL Server Error: 18452
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'(null)'. Reason: Not associated with a trusted SQL Server connection.

I've researched this hi and low, but to no avail, and have read that there
are "many" reasons (but few listed).

Could anyone shed any light in this direction?

Thanks,
Joe


Access app to SQL Server - Login failed for user '(null)'. Reason: Not associated... Invotion
1/26/2004 1:30:40 PM
If this app uses link tables, you might try re-creating
those links and saving the sql login / pw when you do.

Sincerely,
Invotion Engineering Team
Advanced Microsoft Hosting Solutions
http://www.Invotion.com

[quoted text, click to view]
Re: Access app to SQL Server - Login failed for user '(null)'. Reason: Not associated... JRE
1/27/2004 6:45:15 AM
I've done that. It's works for my SQL authentication, but then errors out
for my co-developer with Windows authentication. Go figure...

Thanks for the suggestion,
Joe

[quoted text, click to view]

Re: Access app to SQL Server - Login failed for user '(null)'. Reason: Not associated... Mary Chipman
1/28/2004 9:49:04 AM
The problem you are having involves using DSNs and is one of the
really good reasons not to use them at all. They are user-specific,
have to be created on each user's machine, and are intrinsically not
secure. Best practice would be to create a VBA function that takes
login information (such as integrated security or a SQL
login/password) from a form and uses DAO code to create linked
TableDef (or QueryDef) objects. When your app shuts down (also on
startup), any previously linked objects are deleted. This way there is
no object persistence between sessions and each user connects using
their own credentials. I stress DAO here because, in some versions of
Access, ADOX creates read-only linked tables.

-- Mary
Microsoft Access Developer's Guide to SQL Server
http://www.amazon.com/exec/obidos/ASIN/0672319446

[quoted text, click to view]
Re: Access app to SQL Server - Login failed for user '(null)'. Reason: Not associated... JRE
1/29/2004 9:57:25 AM
Thanks Mary,

This project was short fused and all the end users use Windows
authentication, so an ODBC DSN was fastest to deal with and works ok (so
far). For next year's application update we'll look into your suggestion. I
have your developers guide and rely on it as we move more and more from
Access to SQL Server.

I still think that the app not using the authentication as stored with the
ODBC DSN is either a bug in Access or ODBC. I like ODBC (keeping in mind
it's pitfalls) because of it's ability to automatically refresh the
application datasets with end user changes without any coding (unlike ADO
datasets).

Regards,
Joe

....Good book BTW

[quoted text, click to view]

Re: Access app to SQL Server - Login failed for user '(null)'. Reason: Not associated... Mary Chipman
1/30/2004 5:27:14 PM
FWIW, caching the dsn/security info is a property of the TableDef and
QueryDef objects, which you can set in the UI. The code for relinking
tables is all over the place (www.mvps.org.access for one) and is no
big deal. It will save you a ton of time and grief and is the
recommended best practice. DSN's are are not recommended, but do what
you want -- hopefully you're doing paid support at an hourly rate and
are not being compensated to write an efficient or secure application.

-- Mary
Microsoft Access Developer's Guide to SQL Server
http://www.amazon.com/exec/obidos/ASIN/0672319446

[quoted text, click to view]
Re: Access app to SQL Server - Login failed for user '(null)'. Reason: Not associated... JRE
2/2/2004 2:15:29 PM
Thanks again Mary,

So far there has been zero ODBC DSN problems with the Windows authenticated
users. We'll code the dsn/security and DAO linking after the current usage
stops (the app is to be used only for a few months each fiscal year). So
far, all the changes have been to the app and database to accomodate all the
things the owners originally "forgot", or sudden "must have" wish list
stuff. Security-wise, since it's for the organization I work for, I get paid
wether it needs support or not.

Joe

[quoted text, click to view]

AddThis Social Bookmark Button