VerifyDB (2)




Public Function CheckDatabase() As Boolean
Dim db As Database

On Error GoTo fout_check_database
Set db = OpenDatabase(DBNaam$)
CheckDatabase = True
db.Close
Exit Function

fout_check_database:
MsgBox CStr(Err) & ": " & Error, MB_ICONEXCLAMATION, Titel$
CheckDatabase = False
End Function

'on the main form

DBNaam$ = App.Path & "\data\" & dbName$
'check database

If Not CheckDatabase Then
MsgBox "Start making the database...", MB_ICONEXCLAMATION, Titel$
'call proc to make the database

'you can also show here a drive/dir/list box to let the user

'choose his/her own location!

Call MaakDatabase
End If
Set db = OpenDatabase(DBNaam)










( verifydb2.html )- by Paolo Puglisi - Modifica del 17/12/2023