Been a while since I was last on here (over a year I think...), so I am very rusty at all this and trying to find my feet again.
Can someone clarify something for me which I am confused about.
I am going to be reading and writing to some database files created in Microsoft Access. If I save them as the old style .mdb files I can access them perfect, if they are in the newer .accdb format Purebasic will not open the file an error reported.
My code (which is a simple proof of concept idea at the moment) is this:
Code: Select all
Global curdir.s, imgdir.s
Global TotalEntries=0
Global Dataread.s
curdir.s=Space(250)
GetCurrentDirectory_(250,@curdir)
If Right(curdir,1)<>"\"
curdir+"\Data\"
imgdir=curdir+"Images\"
EndIf
Debug curdir
Debug imgdir
UseODBCDatabase()
db=MDB_Connect(curdir,"Armourhide","","")
If db
Debug "Database has been opened"
Else
Debug "Database has NOT been opened"
EndIf
If DatabaseQuery(db,"Select * from Teletran order by ID asc;")
While NextDatabaseRow(db)
Debug "---"
Dataread=GetDatabaseString(db,1)
Debug "---"
Wend
EndIf
CloseDatabase(db)
TotalEntries=Val(Dataread)
Debug Dataread
Debug TotalEntries
I would rather use the .accdb format if possible rather than the .mdb format. Can someone tell me what I am missing to enable me to do this?
Thanks.
Arcee_UK