EasyDB Translate to English
Posted: Wed Feb 02, 2005 8:14 am
Hi Folks,
I am trying to use the EasyDB lib. However there are no english docs.
So I have begun translating. Here is what I have so far.
The problem occurs on the edbWriteRecord statement near the bottom.
This library is very cool because if you use the userlib then you don't even need the .dll
That means you can have simple database support without any external files.
Any help would be greatly appreciated, if anybody has succesfully added a record to a table please respond, if there is a bug in this library I would like to stop banging my head against the desk
Also I have tried the .dll version and get the same result.
I am trying to use the EasyDB lib. However there are no english docs.
So I have begun translating. Here is what I have so far.
The problem occurs on the edbWriteRecord statement near the bottom.
This library is very cool because if you use the userlib then you don't even need the .dll
That means you can have simple database support without any external files.
Any help would be greatly appreciated, if anybody has succesfully added a record to a table please respond, if there is a bug in this library I would like to stop banging my head against the desk

Also I have tried the .dll version and get the same result.
Code: Select all
;Create Database
user$ = ""
pass$ = ""
filepath$ = getpath() + "mytest.edb"
;Create using definition file
;mytest.txt is plain text file that defines fields
;Paste the following three lines without the semicolon into a .txt file
;Folder;C;200;0
;Filename;C;200;0
;Ext;C;4;0
;filedefpath$ = getpath() + "mytest.txt"
;err = edbCreate(filedefpath$,filepath$,user$,pass$)
;Or create by dynamically adding fields
err = edbCreateNulldb(filepath$, user$, pass$)
err = edbOpen( 1, filepath$, user$, pass$)
err = edbCreateAddField("Folder,C,200,0")
err = edbCreateAddField("Filename,C,200,0")
err = edbCreateAddField("Ext,C,4,0")
err = edbClose(1)
;Now add some records
err = edbOpen(1, filepath$, user$, pass$)
MessageRequester("Open",Str(err))
err = edbAppend()
MessageRequester("Append",Str(err))
err = edbPutIDX(1,"folderdata") ;Field Number , Field Data
err = edbPutIDX(2,"namedata")
err = edbPutIDX(3,"ext")
MessageRequester("PutIdx",Str(err))
err = edbWriteRecord(0) ;Crashhh if value 0 or 1 error -5 if value > 1
MessageRequester("Writerecord",Str(err))
err = edbClose(1)