Search found 72 matches

by npath
Thu Jul 24, 2008 3:27 am
Forum: Coding Questions
Topic: Confused about SQLite...
Replies: 26
Views: 4518

jmauver,

You are correct. Once you copy the DatabaseSQLite library into the PureLibraries folder, PB will then be able to call the functions in the library. The only thing you have to do is restart the compiler so that it will see the new library. After you do this, you will be set.

The problem ...
by npath
Wed Jul 23, 2008 2:40 am
Forum: Coding Questions
Topic: Confused about SQLite...
Replies: 26
Views: 4518

jmauver,

You're welcome. You are right. You do not have to specify a value for the auto-incrementing primary key. SQLite will take care of this for you. By the way, I find that the PB interface works great for most of what I do with SQLite. In fact, I think that Fred has done an excellent job of ...
by npath
Tue Jul 22, 2008 6:53 pm
Forum: Coding Questions
Topic: Confused about SQLite...
Replies: 26
Views: 4518

Autoincrement works fine for me using the native PB interface with SQLite. See below for a generic example.


Procedure main()
Define.l i

If CreateFile(0, "test.db")
CloseFile(0)
Else
MessageRequester("Error", "Can't create file.")
ProcedureReturn
EndIf

UseSQLiteDatabase()

If ...
by npath
Wed Jul 16, 2008 6:34 pm
Forum: Coding Questions
Topic: text.s + "whatever" not working.
Replies: 8
Views: 2043

Whoops. I should have read more of the posts. :oops:
by npath
Wed Jul 16, 2008 1:40 am
Forum: Coding Questions
Topic: text.s + "whatever" not working.
Replies: 8
Views: 2043

It appears that the following two error-related procedures are clearing the memory buffer.


GetErrorDescription()
GetErrorModuleName()


This is shown using this code:


;Set the error handler
OnErrorGoto(?ErrorHandler)
;Trigger a classic 'divide by zero' error.
Null.l = 0
TestVariable.l = 100 ...
by npath
Thu Jul 10, 2008 1:27 am
Forum: Coding Questions
Topic: I need to clean my windows!
Replies: 3
Views: 1273

How about setting an empty image to the imagegadget first, then changing to the new image? Just a thought.
by npath
Tue Jul 08, 2008 6:47 pm
Forum: TailBite
Topic: [DONE] 1.875 (PB 4.20) - Invalid memory access
Replies: 3
Views: 5315

I believe you are right. My problem is with this procedure:


ProcedureDLL.l ParseString(stringToParse.s, arrayToFill.s(1), delimiter.s) ; Parse a string into an array using a delimiter. Returns count.
; Source: Uses code posted by pdwyer
; http://www.purebasic.fr/english/viewtopic.php?t=31044 ...
by npath
Mon Jul 07, 2008 6:11 pm
Forum: TailBite
Topic: [DONE] 1.875 (PB 4.20) - Invalid memory access
Replies: 3
Views: 5315

This problem is listed as "Done". However, I am having the same issue with tailbite. I keep getting "invalid memory access" errors, even with simple procedures. I am using the latest version of Tailbite and PB 4.2 (Windows XP pro and Vista Ultimate). Anyone else having this problem?
by npath
Sat Jul 05, 2008 6:31 pm
Forum: Tricks 'n' Tips
Topic: Saving and retrieving binary files from PB SQLite
Replies: 2
Views: 2242

You can define the table with the blob type, such as:

"create table table1 (binaryFile BLOB)"

However, the current PB implementation does not allow for retrieving pure binary data from the database, or at least not that I have figured out. What we need is something like:

GetDatabaseBlob(#Database ...
by npath
Sat Jul 05, 2008 5:28 pm
Forum: Coding Questions
Topic: Saving and retrieving binary files from PB SQLite
Replies: 2
Views: 1134

I posted this under tips and tricks. A working example may be useful to someone down the road.
by npath
Sat Jul 05, 2008 5:26 pm
Forum: Tricks 'n' Tips
Topic: Saving and retrieving binary files from PB SQLite
Replies: 2
Views: 2242

Saving and retrieving binary files from PB SQLite

This is an example of saving and retrieving binary files using PB's implementation of SQLite. Maybe someone will find this to be helpful. Any thoughts on optimization would be useful.


Procedure.s GetBase64StringFromFile(file.s)
; This uses code posted by netmaestro
; http://www.purebasic.fr ...
by npath
Sat Jul 05, 2008 5:17 pm
Forum: Coding Questions
Topic: Saving and retrieving binary files from PB SQLite
Replies: 2
Views: 1134

Well, the solution was simple. Just needed some morning coffee.


Procedure.s GetBase64StringFromFile(file.s)
; This uses code posted by netmaestro
; http://www.purebasic.fr/english/viewtopic.php?t=32638&highlight=blob

If ReadFile(0, file)
*inputbuffer = AllocateMemory(Lof(0))
If ...
by npath
Sat Jul 05, 2008 5:03 pm
Forum: Coding Questions
Topic: Saving and retrieving binary files from PB SQLite
Replies: 2
Views: 1134

Saving and retrieving binary files from PB SQLite

I am having no problem saving and retrieving binary files using PB's implementation of SQLite (thanks to netmaestro, and of course Fred and Company). However, I would like to optimize this. Because of the requirement that the Base64Encoder output buffer be 33% larger than the input buffer, the ...
by npath
Thu Jul 03, 2008 2:42 am
Forum: Coding Questions
Topic: SQLite Connection Limit
Replies: 42
Views: 7514

Thanks Karbon,

I too have rewritten an application, converting over to built-in SQLite database functionality in PB. I will also wait for a fix, and try to find a work around in the meantime. I have versions of the application in numerous other languages, and find that Purebasic is the best of all ...
by npath
Thu Jul 03, 2008 12:53 am
Forum: Coding Questions
Topic: SQLite Connection Limit
Replies: 42
Views: 7514

Karbon,

Do you have any snippets for doing an update using straight API? Perhaps I can bypass the supposed lock.