Results 1 to 21 of 21

Thread: [RESOLVED] detecting a missing database

Hybrid View

  1. #1
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: detecting a missing database

    I normaly do the following code:
    VB Code:
    1. Set FSys = New FileSystemObject
    2. If gstrDBLoc = "" Then gstrDBLoc = App.Path
    3. If gstrDBName <> "" And FSys.FileExists(gstrDBLoc & "\" & gstrDBName) Then
    4.     OpenDB
    5. Else
    6.     fDBLoc.Show
    7.     Exit Sub
    8. End If
    9.  
    10. If Not FSys Is Nothing Then Set FSys = Nothing

    If the database is not there I open a form and allow the user to point me to the new database location. Altough I do not use the data controls you can just exit out with a message if the database is required to be in a specific place.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: detecting a missing database

    Quote Originally Posted by GaryMazzone
    If the database is not there I open a form and allow the user to point me to the new database location.
    Regardless of what method you end up selecting davypipes, this is an outstanding idea!

    (BTW: Why did you double post this question? )

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2005
    Posts
    23

    Re: detecting a missing database

    sorry for double posting!!! how can i check all my posts(new+old) the moment i log in?is there such a link,coz sometimes i end up searching for my posts using advanced search!!

    anyhooo... thanks guys for all your help...though i dont think the above codes will work with what i have since ive used the built in connectin objects provided by VB(dataenvironment..connection1..ie:have not used code to connect)
    For the database path, i only put the database name,which surprisingly regardless of where i put the folder ,the application still sees the database...coz its within the same folder! now my only problem is to detect and inform the user when the database is missing!!! so guys...emmm...how do i do that in this kind of scenario?
    Last edited by davypipes; Sep 17th, 2005 at 09:37 AM.

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