>
>Subject: Re: [sqlite] Suppressing column (field) headers?
> From: Clay Dowling <[EMAIL PROTECTED]>
> Date: Sun, 21 Nov 2004 19:19:11 -0500
> To: [EMAIL PROTECTED]
>
>[EMAIL PROTECTED] wrote:
>
>>I'm using the 2.8 dll. You seem to be suggesting that I have to
>>move up to the 3.0 dll to get just the data without the headers.
>>
>>Will I still have to strip quotes off text, and an appended newline?
>>
>>I'm not sure what "prepared statements" means. Googling the subject
>>gets me lots of 'xxSQLxxx will do prepared statements' but little
>>explanation of what that is.
>>
>>
>Prepared statements let you write your SQL like this: SELECT name, qty,
>location FROM inventory WHERE id=?
>You then get to substitute any value for ? that you want. It's great
>for avoiding data escaping problems, and speeds up your SQL processing.
OK. As I said in my original post, I send such through a Delphi
procedure. Quoting:
---
1. How can I get the dll to return JUST the desired data?
When I send the following SQL, for example,
select colEntry from tblEntry where colNum = 3
the textbox shows
colEntry
"The text in the column."
<newline>
What I really want is just:
The text in the column.
---
>The part that's relevant for you is that you get your result set back
>one row of data at a time, getting one field for each function call.
>What you get is the raw data without any quotes or trailing newlines or
>labels, in the data type that you asked for.
>
>>some insight, especially the comments. I'm forced to rely on someone
>>else's Delphi wrapper, not all of which I understand.
>>
>>Was this last comment your way of answering my "Can I drop in the
>>3.0x dll and change the 'sqlite.dll' line to 'sqlite3.dll' and expect
>>it to work the same?" question?
>>
>>
>Well, it was a pretty second rate answer in response to your question.
>If you look in the Delphi documentation about external libraries you'll
>see that Delphi can call them directly without really needing a
>wrapper. The sqlite3 dll won't be a drop in replacement, but it will
>let you get the data back in a way that's likely to be more useful to
>you.
I tried. It didn't work right. Don't know enough yet about calling DLLs to
know why. It claims the library isn't loaded.
>All you need is a single pascal unit that imports the functions
>defined in the DLL (or at least the functions you need). The Delphi
>documentation will have examples of how to write that module. Then you
>make Delphi calls to access the data in exactly the same way that you
>would access it from a C program. This means that the C documentation
>now also works for you writing in Delphi.
I presume you mean the structure in the TSQLite code I'm using, which begins:
SQLite_Open: function(dbname: PChar; mode: Integer; var ErrMsg: PChar):
Pointer; cdecl;
SQLite_Close: procedure(db: Pointer); cdecl;
SQLite_Exec: function(db: Pointer; SQLStatement: PChar; CallbackPtr: Pointer;
Sender: TObject; var ErrMsg: PChar): integer; cdecl;
etc.
>If you can wait a little while, I actually need to write a Delphi
>interface to SQLite myself, and I can send you the Pascal unit and a
>short example off list.
All info a welcome part of the puzzle, I'm sure. Off list is fine,
but please use the [sqlite] thingie in the header, if you can think
of it, as I get 100 pieces of spam a day to this account.
Thanks