+ Reply to Thread
Results 1 to 2 of 2

Sql server login prompt

  1. #1
    Isabel_ve
    Guest

    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. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1