Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server Login Ronald Excel Discussion (Misc queries) 14 December 2nd 08 11:27 AM
Automatic OLE login prompt Bitstreams Excel Discussion (Misc queries) 0 November 5th 08 10:33 AM
is it possible to disable "save" prompt in excel file on web server? [email protected] Excel Discussion (Misc queries) 0 May 9th 07 05:58 PM
SQL Server Login GregR Excel Programming 2 January 31st 06 07:57 PM
Prompt user login when refresh data Terence Excel Programming 0 February 21st 05 03:10 AM


All times are GMT +1. The time now is 08:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"