$$$ Well in Bill's case it is purely mercenary since he is Aaron
Ballman's partner in RBLibrary.com. $$$

In the spirit of actually giving answers, I sent Greg a very simple
sample database offlist to show him how to create one in code. It
creates a new database if it does not find one located in the same
directory as the app. I usually create a global property in a
DatabaseMethods module for a REALSQL database: DB As REALSQLDatabase
...and  another global property DBfile As Folderitem. This way I don't
have to dimension them every time I want to connect. I just use a
function in the same module called DBconnect and pass it the name of the
database as a string. Alternatively I could change the method and pass
it a FolderItem If I wanted the user to be able to open multiple
versions of the same database. If I am only working with one REALSQL
database I usually only connect to it once and stay connected as long as
the app is running.
 
Function DBcreateDatabase(MyFile As String) As Boolean
 
  DBfile = New FolderItem(MyFile)
  DB = New REALSQLdatabase
  DB.databaseFile = DBfile
  
  If DB.CreateDatabaseFile Then
      Return True
  Else
    MsgBox "Database not created"
    Return False
  End If
 
End Function
 
 
Function DBconnect(MyFile As String) As Boolean
 
  DB= New REALSQLdatabase
  DBfile = GetFolderItem(MyFile)
  
  If DBfile <> Nil And DBfile.Exists Then
    DB.DatabaseFile = DBfile
    If DB.Connect() Then
      Return True
    Else
      Beep
      MsgBox "The database couldn't be opened."
      Return False
    End If
  Else
    MsgBox "The Database file is invalid or does not exist."
    Return False
  End If
 
End Function

If you would like to see this sample project you can download it here.
http://home.comcast.net/~digimana/downloads/SampleREALSQLdb.zip

> 
> On 30/01/2006, at 5:24 AM, Bill Marcy wrote:
> 
> > There will be a great tutorial coming on RBLibrary.com in the next 
> > week or so, with not only step by step directions on 
> database creation 
> > and usage, but also modules to drop into your existing 
> project.  Check 
> > http://www.rblibrary.com around thursday for it (It will be 
> a featured 
> > article!)
> ****
> Don't know if I'm the only one but I miss the days when 
> people gave answers instead of an address to a paid response <sigh>
> 
> 
> // k
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

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

Reply via email to