VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Open and Close a database

by Marc Ferr¨ Moliner (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 27th November 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Open and Close a database

API Declarations


Public db As Database

Rate Open and Close a database




Function OpenDB()As Boolean
On Error GoTo Erroropening
Set db = DBEngine.Workspaces(0).OpenDatabase(databas)
OpenDB = True
Exit Function
Erroropening:
OpenDB = False
MsgBox "Error: " & Err.Number & " - " & Err.Description
End Function


Function CloseDB()As Boolean
On Error GoTo Errorclose
db.Close
Set db = Nothing
closeDB = True
Exit Function
ErrorClose:
CloseDB = False
End Function


Download this snippet    Add to My Saved Code

Open and Close a database Comments

No comments have been posted about Open and Close a database. Why not be the first to post a comment about Open and Close a database.

Post your comment

Subject:
Message:
0/1000 characters