Loading of NonExistant Database files 
Author Message
 Loading of NonExistant Database files

Hi there,
I working with an application that uses the Data control to load up a
database file.  I supply the Data1.DatabaseName and Data1.RecordSource
properties with the appropriate information and then use the Refresh
method to load up the file.  I wanted to force the loading of a
nonexistant file to see what Error number I would get so I could write
an error message.  As it turns out, the Err.number is 3024. I thought
that when I ran the code my message would be the only one to show, but I
was mistaken.  I get my message and the systems message one after the
other. Is there some way to write this so that only my message is shown
and not the systems message?

On Error GoTo LocalErr
'open database if one exists in the registry
If CurrentDBase <> "" Then
   Data1.DatabaseName = CurrentDBase
   Data2.DatabaseName = CurrentDBase
   Data1.RecordSource = "Contacts"
   Data2.RecordSource = "Correspondance"
   Data1.Refresh   ' Open the Database.
   Data1.Caption = CurrentDBase
End If

   Screen.MousePointer = vbDefault
   Exit Sub

   If Err.Number = 3024 Then  'missing file
      MsgBox "The file " & CurrentDBase & " has either been corrupted,
moved, or deleted."
      Screen.MousePointer = vbDefault
      Exit Sub
   End If



Wed, 08 Nov 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Help,loading binary database file when loading program

2. Please help(loading binary database file when loading program

3. Loading Access Database from large text files

4. how to load a file to database?

5. how to load a file to database?

6. Can I load in vb a text delimited file to a existing access database

7. loading a database file when starting program

8. opening database file when loading program

9. Dear Guru: Loading a file dynamically from a database field

10. Getting the database file name at load time

11. Save and load picture files in database by using ADO !(SRC)

12. Load XML file to a RecordSet then Update Database using ADO


Powered by phpBB® Forum Software