Results 1 to 4 of 4

Thread: query unload question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    UK
    Posts
    300
    In my query unload event I want to check if the database is still connected. If the DB is connected then a data transfer is in operation and I dont want the user to be able to shut it down until the transfer is complete. The connection is set to nothing at the end of the transfer sub so then it will be safe to close down the app.

    I want to say something like
    if db1 is open / connected then
    cancel = -1 (don't allow)
    end if

    how can I achive this, I have seen it for a recordset in my VB book

    The line : If db1 connected / open then : is what I need to know.

    Thanks
    Locutus


    [Edited by locutus on 08-10-2000 at 11:24 AM]
    Resistance is futile

  2. #2
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Cancel = 1
    Courgettes.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    UK
    Posts
    300

    you may have misunderstood

    maybe I didn't make it clear , how do I chech to see if the database is still connected. This is what I am having trouble with.

    how do I write in code

    if db1 connected / open then





    Thanks Guys
    Locutus
    Resistance is futile

  4. #4
    Lively Member
    Join Date
    Jul 2000
    Posts
    104
    You could check to see if you db object variable is set to nothing:

    Code:
    If db Is Nothing Then
       'close the app
    Else
       'display msg to user
    End If
    What I do is have an Enum set up for the different edit modes that app may may. When the app is in edit mode and the user wanted to close the app the code would check the current edit mode and respond accordingly.

    It's up to you.

Posting Permissions

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



Click Here to Expand Forum to Full Width