SQLite on Mac OS X 10.6 (PB 4.51)

Mac OSX specific forum
User avatar
bembulak
Enthusiast
Enthusiast
Posts: 576
Joined: Mon Mar 06, 2006 3:53 pm
Location: Austria

SQLite on Mac OS X 10.6 (PB 4.51)

Post 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!
cheers,

bembulak
User avatar
Kiffi
Addict
Addict
Posts: 1510
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

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

Post by Kiffi »

Hello bembulak,

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

Greetings ... Kiffi
Hygge
User avatar
bembulak
Enthusiast
Enthusiast
Posts: 576
Joined: Mon Mar 06, 2006 3:53 pm
Location: Austria

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

Post 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!
cheers,

bembulak
User avatar
bembulak
Enthusiast
Enthusiast
Posts: 576
Joined: Mon Mar 06, 2006 3:53 pm
Location: Austria

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

Post 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!
cheers,

bembulak
Post Reply