I followed the example Project.rbp, but it did NOT
create any table or even insert any record.
What did I do wrong? Thanks for your help.
__________________
Dim dbPath, dbDatFile, dbase As String
Dim dbFile As FolderItem
Dim rec As DatabaseRecord
dbPath = "db/"
dbDatFile = "Catalog.rsd"
dbase = dbPath + dbDatFile
App.CatalogDB = New REALSQLDatabase
dbFile = GetFolderItem( dbase )
App.CatalogDB.DatabaseFile = dbFile
If Not GetFolderItem( dbase ).Exists Then
If Not App.CatalogDB.CreateDatabaseFile Then
MsgBox "Database Error" + EndOfLine + EndOfLine
+ "There was an error when creating the database."
Quit
End If
End If
App.CatalogDB.SQLExecute "DROP TABLE IF EXISTS
Category"
App.CatalogDB.SQLExecute "CREATE TABLE Category ( id
Integer PRIMARY KEY AUTOINCREMENT, Category VarChar,
cCategory VarChar ) "
App.CatalogDB.SQLExecute "DROP TABLE IF EXISTS Type"
App.CatalogDB.SQLExecute "CREATE TABLE Type( id
Integer PRIMARY KEY AUTOINCREMENT, Type VarChar, cType
VarChar )"
CatalogDB.SQLExecute "INSERT INTO Category (
Category, cCategory ) VALUES ( 'Heart', '心' )"
rec = New DatabaseRecord
rec.Column("Category") = "Heart"
rec.Column("cCategory") = "心"
App.CatalogDB.InsertRecord "Category", rec
If Not CatalogDB.Connect Then
DisplayDatabaseError()
Quit
End If
_______________________________________________
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>