|
-
Aug 10th, 2000, 10:08 AM
#1
Thread Starter
Hyperactive Member
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]
-
Aug 10th, 2000, 10:13 AM
#2
Fanatic Member
-
Aug 10th, 2000, 10:23 AM
#3
Thread Starter
Hyperactive Member
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
-
Aug 10th, 2000, 11:00 AM
#4
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|