At 08:00 -0500 30/08/2002, Andrew Schox wrote:
I've decided to try using a REALdatabase for a small project I'm working on.
I'm having problems opening a REALdatabase file (which I previously created
with another RB project). I can however open this file by dragging it into
an RB project and I can see the data structure as well as the data.
My code is as follows (excuse the line wraps):
dim dbFile as folderItem
dim db as realdatabase
db = new realdatabase //after this line, the error property is true and
the error code is -1 (which means?). There is no error message
dbFile = GetFolderItem("myDB") //after this, dbFile points to a valid
realdb file
db.DatabaseFile = dbFile //after this, db points to the dbFile in its
DatabaseFile property. Error code is still -1
If db.error then
MsgBox (str(db.errorcode) + db.errormessage) // Error -1 displayed
else
// I'd like to have done some stuff here
db.close
end if
Can anyone see what I'm doing wrong? Needless to say, the online docs don't
appear to be up to date. I have successfully used Valentina as well as a
load of other server databases in the past without any problems.
I'm using 4.5.1 fc3 (4.5 crashed everytime I tried to view the databasefile
property of the database in the debugger).
after the line :
db.databasefile=dbfile
write these commands
if db.connect then
...... do something
else
msgbox"can't open 'myDB'"
quit
end if
|