gettingstarted
[Top] [All Lists]

Re: Can't connect to database

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Can't connect to database
From: Ian Mann <ian at ianmann dot demon dot co dot uk>
Date: Mon, 31 May 2004 09:01:01 +0100
Delivered-to: gettingstarted at lists dot realsoftware dot com
List-help: <mailto:gettingstarted-request@lists.realsoftware.com?subject=help>
List-id: Getting Started <gettingstarted.lists.realsoftware.com>
List-post: <mailto:gettingstarted@lists.realsoftware.com>

On Monday, May 31, 2004, at 03:30  am, Wayne Dreier wrote:

I'm working on a project and created a database. In my front end application in the open event of the window I copied the code from page 409 of the LR which gives an example of how to open an existing REALdatabase.

Here is the code:

  Dim DbFile As FolderItem
  Dim DB As REALdatabase
  DB = New REALdatabase
DbFile = Volume(0).Child("Users").Child("waynedreier").Child("Documents").Child( "Real Basic Files").Child("SourceLogDatabase")
  DB.DatabaseFile = DbFile
  If DB.Connect() Then
    MsgBox "Database exists"
  Else
    Beep
    MsgBox "Error message: " +DB.ErrorMessage
  End If

The code runs but shows a message box "Error message: " and no error code. I think I know why it is showing an error. Even though the database is in the file in the parent-child path I use, the exist property is showing false.

I don't understand how that can be?

Any suggestions on what I should do to get this database open?


Hi Wayne,

You might check that you have added the SourceLogDatabase as a datasource to the project, and that it appears in the project window.

You might also use

DbFile = GetFolderItem ("SourceLogDatabase")
DB.DatabaseFile = DbFile

if the database is in your application folder. - If not you might think about moving it there.

Also make sure that nothing else - like the IDE - is looking at the DB while you are trying to connect.

HTH

Ian

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>