Posted: Wed Oct 18, 2006 6:27 pm
Hmm, I dont use unicode, and dont use the broken threadsafe subsystem either. What did you do to get it to work?
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
Debug SQLite3_GetLibVersion()
Debug ""
If SQLite3_InitLib("sqlite3.dll") = #False
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
End
EndIf
sDB.s = "sample.db"
dbHandler = SQLite3_CreateDatabase(sDB, 1)
If dbHandler = 0
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
End
EndIf
; Create test-table to fill with data
sSQL.s = "Create Table TestTable (fld0, fld1, fld2)"
SQLite3_Execute(sSQL, dbHandler)
zeit1= ElapsedMilliseconds()
; Use transactions to speed up insert-statements!
sSQL = "BEGIN TRANSACTION"
SQLite3_Execute(sSQL, dbHandler)
; fill 1000 Records into the test-table
For intI = 0 To 999
sSQL.s = "Insert Into TestTable (fld0, fld1, fld2) Values ('value_0_" + Str(intI) + "', 'value_1_" + Str(intI) + "', 'value_2_" + Str(intI) + "')"
SQLite3_Execute(sSQL, dbHandler)
Next intI
; commit the transaction
sSQL = "COMMIT"
SQLite3_Execute(sSQL, dbHandler)
zeit2= ElapsedMilliseconds()
Define.SQLite3_Recordset RS ; declare Recordset-'Object'
; determine count of records
If SQLite3_GetRecordset("Select Count(*) As CountOfRecords From TestTable", dbHandler, @RS )
If RS\Handle
If SQLite3_GetRecordsetValueByName("CountOfRecords", @RS)
Debug RS\sValue + " Records in " + Str(zeit2-zeit1) + " milliseconds inserted"
Else
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf
EndIf
Else
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf
If SQLite3_GetRecordset("Select * From TestTable Limit 5", dbHandler, @RS)
If RS\Handle
Debug ""
Debug "Amount of columns: " + Str(RS\Cols)
Debug "Amount of rows: " + Str(RS\Rows)
Debug ""
Debug "Index of then field named 'fld2': " + Str( SQLite3_GetFieldIndexByName("fld2", @RS) )
Debug ""
Debug "SQLite3_RecordsetMoveNext():"
Debug "----------------------------"
; Browse through the records forward
While RS\EOF = 0
If SQLite3_GetRecordsetValueByName("fld0", @RS)
Debug RS\sValue
Else
MessageRequester("", SQLite3_GetLastMessage())
EndIf
SQLite3_RecordsetMoveNext(@RS)
Wend
Debug ""
Debug "SQLite3_RecordsetMovePrevious():"
Debug "--------------------------------"
; Browse through the records backwards
While RS\BOF = 0
If SQLite3_GetRecordsetValueByName("fld0", @RS)
Debug RS\sValue
Else
MessageRequester("", SQLite3_GetLastMessage())
EndIf
SQLite3_RecordsetMovePrevious(@RS)
Wend
Debug ""
Debug "SQLite3_RecordsetMoveFirst():"
Debug "-----------------------------"
; Jump to the first recordset
SQLite3_RecordsetMoveFirst(@RS)
If SQLite3_GetRecordsetValueByName("fld0", @RS)
Debug "Content of field 'fld0' of the first recordset (ByName):"
Debug RS\sValue
Else
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf
If SQLite3_GetRecordsetValueByIndex(0, @RS)
Debug "Content of field 'fld0' of the first recordset (ByIndex):"
Debug RS\sValue
Else
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf
Debug ""
Debug "SQLite3_RecordsetMoveLast():"
Debug "----------------------------"
; Jump to the last recordset
SQLite3_RecordsetMoveLast(@RS)
If SQLite3_GetRecordsetValueByName("fld0", @RS)
Debug "Content of field 'fld0' of the last recordset (ByName):"
Debug RS\sValue
Else
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf
If SQLite3_GetRecordsetValueByIndex(0, @RS)
Debug "Content of field 'fld0' of the last recordset (ByIndex):"
Debug RS\sValue
Else
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf
; Release Recordset after use
SQLite3_ReleaseRecordset(@RS)
Else
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf
Else
MessageRequester("SQLite3-Demo", SQLite3_GetLastMessage())
EndIf
SQLite3_CloseDatabase(dbHandler)
SQLite3_End()
End
I have no vista and will never installSFSxOI wrote:Will the help for this library collection be updated to work with Vista?
I have read, only helpfiles (*.hlp) not supported, but you can download, thatDoubleDutch wrote:I think Vista has yet another new type of help file.
ts-soft wrote:I have read, only helpfiles (*.hlp) not supported, but you can download, thatDoubleDutch wrote:I think Vista has yet another new type of help file.
this works. CHM should work on vista. If not, so give me someone informations, what is to change.
ts-soft wrote:I can't test this. The source is available on: http://cvs.pureforge.net/pbosl/
or pm me, i will send the source, to anybody that will help, make changes for
vista.
To hear delightedly, thisSFSxOI wrote: I've spent the better part of the day running thru some of the PBOSL libraries, and all that i've checked so far seem to work in Vista
Code: Select all
IsPIDAlive() is not a function, array, macro, or linked list