Page 1 of 1

SQLite on Mac OS X 10.6 (PB 4.51)

Posted: Fri Nov 05, 2010 8:56 am
by bembulak
Hi guys!

Could anyone give me a hint, why this does not work on Mac OS X?
It works perfect on Win 32 (XP SP 3) and Linux!

Code: Select all

UseSQLiteDatabase()

#dbn = "working_colours.db"

If OpenDatabase(1, #dbn, "", "") ; also doesn't work with OpenDatabase(1, #dbn", "", "", #PB_Database_SQlite)
  Define sqQ.s = "SELECT * FROM colours"
  
   If Not DatabaseQuery(1, sqQ) 
     Debug "Query failed!"
     DatabaseError()
  End
EndIf
 
 While NextDatabaseRow(1)
  cstr.s = GetDatabaseString(1, 1) + Chr(59) + GetDatabaseString(1, 2) + Chr(59) + GetDatabaseString(1, 3) + Chr(59) + GetDatabaseString(1, 4) + Chr(59) + GetDatabaseString(1, 5) + Chr(59) + GetDatabaseString(1, 6)
  Debug cstr
 Wend
  FinishDatabaseQuery(1)
Else
  Debug  DatabaseError()
  End
EndIf

CloseDatabase(1)
Thanks!

Re: SQLite on Mac OS X 10.6 (PB 4.51)

Posted: Fri Nov 05, 2010 10:42 pm
by Kiffi
Hello bembulak,

the path is correct? (Debug FileSize("working_colours.db"))

Greetings ... Kiffi

Re: SQLite on Mac OS X 10.6 (PB 4.51)

Posted: Sun Nov 07, 2010 12:40 am
by bembulak
the path is correct? (Debug FileSize("working_colours.db"))
The weird thing is:
Opening the database seems to work. The whole

Code: Select all

If OpenDatabase(...
thing seems to work correct, just the Query fails.
Hm, did not test for the path. But I'll take a look!
Thanks for the hint, mate!

Re: SQLite on Mac OS X 10.6 (PB 4.51)

Posted: Mon Nov 08, 2010 8:51 am
by bembulak
Found the reason!

The source was on a network volume, so it couldn't be opened (for whatever reason).
After some time and debugging I tried to copy the whole source tree to my local volume and then it worked.
Thanks for the hint, Kiffi!