Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sql server login prompt
Is it possible to prevent that the 'sql server login'-prompt will be shown
when it's not possible to make a connection to the database? It is not our purpose that our users know the userid and password. When they can't make a connection to the database they have to restart the application (excel-file) or press our refresh connection-state button. I just want to show a messagebox 'Could not make a connection to the database' instead of the 'sql server login'-prompt. Does someone know if it is or how it's possible? TIA, Isabel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sql server login prompt
Some clarification from you would be helpful as to how you are accessing the SQL database. From your comments I guess you are setting up a connecting on startup and have a refresh connection button but that the code can terminate and so you lose your connection. In this situation if you test the connection or database object eg: if cnn is nothing then do_the_reconnection_code Although this should work it does imply that you are not closing objects properly. To manage this Set up a class object to handle the connection and other database objects. Then define a global variable AS NEW myCLASS. The advantage of thios is that you can automatically manage the opening and closing of the connection through the class initialise and class terminate events. If you want help on this post again - or I have posted similar responses before. hope this helps. regards -- tony h ------------------------------------------------------------------------ tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074 View this thread: http://www.excelforum.com/showthread...hreadid=568231 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SQL Server Login | Excel Discussion (Misc queries) | |||
Automatic OLE login prompt | Excel Discussion (Misc queries) | |||
is it possible to disable "save" prompt in excel file on web server? | Excel Discussion (Misc queries) | |||
SQL Server Login | Excel Programming | |||
Prompt user login when refresh data | Excel Programming |