Error handler not catching SQL Server Connection failure

D

Dale Fye

Access 2003.

I've created my own Linked Table manager for use in several of my
applications. It is running fine when I use Windows authentication, or when
I use a valid userid and password, but when I try to log in with an invalid
userid/password, I get a Microsoft SQL Server Login error message which is
not handled by my error handler. The message looks like:

Connection failed:
SQLState:'01000'
SQL Server Error: 2
[Microsoft][ODBC SQL Server Driver][Shared Memroy]ConnectionOpen
(Connect()).
Connection failed:
SQLState: '08001'
SQL Server Error:17
{Microsoft][ODBC SQL Server Driver][Shared Memory] SQL Server does not exist
or access denied.

When I click OK, it pops ut a SQL Server Login dialog box. I want to
replace this process with my own error handling, but Access is not trapping
the SQL Server error. Is there any way to get around this so I can ensure
that the user is entering the connection info into my application?
 
A

Alex Dybenko

Hi,
it looks like that you are trying to link table with wrong login/password.
Before doing this - check that connection is ok running a pass-through query
for example, then you can bring your own error message and login screen

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 
S

Stefan Hoffmann

hi Dale,

Dale said:
I've created my own Linked Table manager for use in several of my
applications. It is running fine when I use Windows authentication, or when
I use a valid userid and password, but when I try to log in with an invalid
userid/password, I get a Microsoft SQL Server Login error message which is
not handled by my error handler.
Sure? The error indicates that to server instance could not be found and
it wasn't possible to create a connection. This should depend on the
server name not on your user credentials.



mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top