Re: [sqlite] Re: Unicode Help

2006-12-07 Thread Chris Hanson

On Dec 5, 2006, at 8:42 AM, Igor Tandetnik wrote:


Da Martian <[EMAIL PROTECTED]> wrote:

So if I look at a name with umlaughts in the database via sqlite3.exe
I get:

Städt. Klinikum Neunkirchen gGmbH
  --
  |
  an "a" with two dots on top


"A with umlaut" is represented as two bytes in UTF-8.


This is a huge simplification.  At a bare minimum, 'ä' can be  
represented as either one or two Unicode code points -- one code point  
represented 'ä' or one representing 'a' and one representing the '¨'  
combining mark.  How *that* is represented in the UTF-8 encoding of  
Unicode is another issue, that depends on the exact values of the code  
points involved.


The particular example of 'ä' be represented as two bytes in UTF-8 in  
both cases (I don't know offhand) but that's not something that can be  
generalized.


  -- Chris


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Unicode Help

2006-12-07 Thread Trevor Talbot

On 12/7/06, Da Martian <[EMAIL PROTECTED]> wrote:


Yeah I am currently using VirtualTree from Mikes Delphi Gems. Its fully
unicode enabled (I beleive). I use WideStrings through out the entire
pipeline from xml I recieve into SQLite via the prepare16 back out through
column_text16 into virtual tree. Well thats true, the SQL APIs are mapped to
return PWideChar which is then copied via System.Move into a widestring as
follows:


[ DLL interfaces ]


Previously (before my langauge headaches :-)  ) I was doing the above
without the APIs ending in 16, and everything was string and PChar in the
above layer. The layer that used this class has always had "WideString".

I realise your probably not delphi pros, but if you do spot something stupid
I am doing I would appreciate any help you can offer.


I've never used Delphi, "but I did sleep at a Holiday Inn last night"...

It looks fine to me.  To help check it, one thing you can try is
writing the result of FieldAsString directly to a file as raw bytes,
then in notepad open that with "encoding" set to "Unicode".  E.g.
something logically equivalent to:

 size := Length(field) * 2;
 SetLength(buffer, size );
 System.Move(field^, buffer^, size);
 file.Write(buffer, size);

I imagine you don't have to jump through hoops like that, but
hopefully you see what I have in mind.  If the result looks good in
notepad, then you know this layer is fine, so the problem must be
closer to the display layer.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] about call back of sqlite.

2006-12-07 Thread hongsion
Hi sqlite,
I want to using sqlite this way.  Application  A  register callback
to sqlite db. And application B  will modify sqlite db. I want each time
sqlite was modified by B, A is notified by callback. Is this possible in
sqlite?  A and B run in different process. Thanks!


-邮件原件-
发件人: jose isaias cabrera [mailto:[EMAIL PROTECTED] 
发送时间: 2006年12月8日 12:59
收件人: sqlite-users@sqlite.org
主题: Re: [sqlite] Interbase to SQLite



Indeed, my friend.  D is as fast as c, but as easy to code as jscript, c#
and java.  And it's compiled language.  Stand alone without JRE or some
special library.


- Original Message - 
From: "RB Smissaert" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 07, 2006 6:00 PM
Subject: RE: [sqlite] Interbase to SQLite


> Now do you reckon with D I could move data fast from Interbase to SQLite?
>
> RBS
>
> -Original Message-
> From: jose isaias cabrera [mailto:[EMAIL PROTECTED]
> Sent: 07 December 2006 22:31
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Interbase to SQLite
>
>
> I would suggest the Programming Language D, my friend. :-)
>
> http://www.digitalmars.com/d/index.html
>
> The easiest and fastest language ever.  Here is an example on how to use 
> it
> with sqlite:
>
> http://www.dprogramming.com/enticeaddrbook.html
>
> you will have to go to the d forums and ask for help, but I am just giving
> you the easiest and a more  powerful way than VB/VBA.
>
> Enjoy your new found programming language.
>
>
> - Original Message - 
> From: "RB Smissaert" <[EMAIL PROTECTED]>
> To: 
> Sent: Thursday, December 07, 2006 5:11 PM
> Subject: RE: [sqlite] Interbase to SQLite
>
>
>> OK, I think I get it now.
>> There is no ready made dll, but I have to write one in C or C++.
>> Trouble is I only know VB/VBA, so not too easy then.
>>
>> RBS
>>
>>
>> -Original Message-
>> From: Fred Williams [mailto:[EMAIL PROTECTED]
>> Sent: 07 December 2006 17:43
>> To: sqlite-users@sqlite.org
>> Subject: RE: [sqlite] Interbase to SQLite
>>
>> well, now that you have one of the most powerful development platforms
>> in the known universe installed, study up a bit (won't require much) on
>> the "VCL" concept.
>>
>> There are VCL's available for both Interbase and SQLite.  Install them
>> and sail on...  Or, if you are an old "C" coder break out the whip with
>> nails embedded and slog and flog on through the relevant API's.  You
>> will feel right at home :-)
>>
>> Fred
>>
>>> -Original Message-
>>> From: [EMAIL PROTECTED]
>>> [mailto:[EMAIL PROTECTED]
>>> Sent: Thursday, December 07, 2006 10:19 AM
>>> To: sqlite-users@sqlite.org
>>> Subject: Re: [sqlite] Interbase to SQLite
>>>
>>>
>>> Hi Dennis,
>>>
>>> I have installed the whole lot and it went very smoothly.
>>> Now though I am not sure what the next step is. Were you saying there
>>> was a driver to connect to both Interbase and SQLite like an
>>> ODBC driver?
>>> Or did you have something else in mind?
>>>
>>> RBS
>>>
>>> > RB Smissaert wrote:
>>> >> Unfortunately it looks it needs installing the .NET
>>> framework and J#.
>>> >> I will keep it in mind, but for now that has put me off this route.
>>> >>
>>> >>
>>> > Yes, since Turbo C++ is based on BDS 2006 which supports C# and
>>> > Delphi.Net development. As a result it uses .Net to support
>>> the .Net SDK
>>> > in the help system used for .Net development. So the .Net
>>> framework and
>>> > SDK are prerequisites. I am fairly certain the IDE itself
>>> (i.e. editor,
>>> > project manager, compiler, etc.) does not use .Net, they
>>> were just too
>>> > lazy to remove the requirements for the new single language Turbo
>>> > versions. In fact, I think I saw some instructions for
>>> installing BDS
>>> > without the .Net framework somewhere on the web, but I
>>> don't know where.
>>> >
>>> > If you are doing straight Win32 development, and Turbo C++ only does
>>> > Win32, your application will not need .Net.
>>> >
>>> > I'm not sure why you think you needed J#, but that is not
>>> required to
>>> > the best of my knowledge.
>>> >
>>> > Dennis Cote
>>> >
>>> >
>>> --
>>> ---
>>> > To unsubscribe, send email to [EMAIL PROTECTED]
>>> >
>>> --
>>> ---
>>> >
>>> >
>>> >
>>>
>>>
>>>
>>>
>>> --
>>> ---
>>> To unsubscribe, send email to [EMAIL PROTECTED]
>>> --
>>> ---
>>>
>>
>>
>>
>

>> -
>> To unsubscribe, send email to [EMAIL PROTECTED]
>>
>

>> -
>>
>>
>>
>>
>>
>

> -
>> To unsubscribe, send 

Re: [sqlite] Unicode Help

2006-12-07 Thread Scott Hess

On 12/7/06, Nuno Lucas <[EMAIL PROTECTED]> wrote:

On 12/7/06, Da Martian <[EMAIL PROTECTED]> wrote:
> Ok, that does answer one of my questions I think. If I passed something not
> in UTF-8 to sqlite would it return it exactly the same way I passed it in?
> From your statement of chaos below I assume it wont if that data somehow
> violates UTF-8. So I need to get it to UTF-8 or UTF16 before I insert.

SQLite doesn't care much about what you feed it (remember you can also
have BLOB's in fields), so if you feed it invalid UTF-8, it's invalid
UTF-8 you get on return.


This can also be broken if you do things like pass nul-terminated text
with a length of -1.  Anything which is not valid UTF-8 text should
always be stored as BLOB and accessed in blob fashion.  [Note that
ASCII is valid UTF-8.]

-scott

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Interbase to SQLite

2006-12-07 Thread jose isaias cabrera



Indeed, my friend.  D is as fast as c, but as easy to code as jscript, c#
and java.  And it's compiled language.  Stand alone without JRE or some
special library.


- Original Message - 
From: "RB Smissaert" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, December 07, 2006 6:00 PM
Subject: RE: [sqlite] Interbase to SQLite



Now do you reckon with D I could move data fast from Interbase to SQLite?

RBS

-Original Message-
From: jose isaias cabrera [mailto:[EMAIL PROTECTED]
Sent: 07 December 2006 22:31
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Interbase to SQLite


I would suggest the Programming Language D, my friend. :-)

http://www.digitalmars.com/d/index.html

The easiest and fastest language ever.  Here is an example on how to use 
it

with sqlite:

http://www.dprogramming.com/enticeaddrbook.html

you will have to go to the d forums and ask for help, but I am just giving
you the easiest and a more  powerful way than VB/VBA.

Enjoy your new found programming language.


- Original Message - 
From: "RB Smissaert" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, December 07, 2006 5:11 PM
Subject: RE: [sqlite] Interbase to SQLite



OK, I think I get it now.
There is no ready made dll, but I have to write one in C or C++.
Trouble is I only know VB/VBA, so not too easy then.

RBS


-Original Message-
From: Fred Williams [mailto:[EMAIL PROTECTED]
Sent: 07 December 2006 17:43
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] Interbase to SQLite

well, now that you have one of the most powerful development platforms
in the known universe installed, study up a bit (won't require much) on
the "VCL" concept.

There are VCL's available for both Interbase and SQLite.  Install them
and sail on...  Or, if you are an old "C" coder break out the whip with
nails embedded and slog and flog on through the relevant API's.  You
will feel right at home :-)

Fred


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, December 07, 2006 10:19 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Interbase to SQLite


Hi Dennis,

I have installed the whole lot and it went very smoothly.
Now though I am not sure what the next step is. Were you saying there
was a driver to connect to both Interbase and SQLite like an
ODBC driver?
Or did you have something else in mind?

RBS

> RB Smissaert wrote:
>> Unfortunately it looks it needs installing the .NET
framework and J#.
>> I will keep it in mind, but for now that has put me off this route.
>>
>>
> Yes, since Turbo C++ is based on BDS 2006 which supports C# and
> Delphi.Net development. As a result it uses .Net to support
the .Net SDK
> in the help system used for .Net development. So the .Net
framework and
> SDK are prerequisites. I am fairly certain the IDE itself
(i.e. editor,
> project manager, compiler, etc.) does not use .Net, they
were just too
> lazy to remove the requirements for the new single language Turbo
> versions. In fact, I think I saw some instructions for
installing BDS
> without the .Net framework somewhere on the web, but I
don't know where.
>
> If you are doing straight Win32 development, and Turbo C++ only does
> Win32, your application will not need .Net.
>
> I'm not sure why you think you needed J#, but that is not
required to
> the best of my knowledge.
>
> Dennis Cote
>
>
--
---
> To unsubscribe, send email to [EMAIL PROTECTED]
>
--
---
>
>
>




--
---
To unsubscribe, send email to [EMAIL PROTECTED]
--
---








-
To unsubscribe, send email to [EMAIL PROTECTED]




-







-

To unsubscribe, send email to [EMAIL PROTECTED]



-






-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Searching for data

2006-12-07 Thread jose isaias cabrera

Thanks, this one does work.

- Original Message - 
From: "Dan Baker" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, December 07, 2006 6:24 PM
Subject: Re: [sqlite] Searching for data



I do this in the following way:

SELECT * FROM tbl WHERE
(cola LIKE '%hello%' OR colb LIKE '%hello%' OR colc LIKE '%hello%')
AND
(cola LIKE '%juan%' OR colb LIKE '%juan%' OR colc LIKE '%juan%')
AND
(cola LIKE '%casa%' OR colb LIKE '%casa%' OR colc LIKE '%casa%')

This will return all records that have every word in them somewhere.

DanB


- Original Message - 
From: "jose isaias cabrera" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, December 07, 2006 3:55 PM
Subject: [sqlite] Searching for data




Greetings.

I have a table with many columns.  I would like to find records 
google-like on all the records.  Say, for example the searching criteria 
is


hello juan casa

I would like to have any record that has all of those tokens in any of 
the columns.


how would I do that with a select?  (imagine the table has cola, colb, 
colc.)


thanks,

josé



-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Using ODBC with Microsoft Access

2006-12-07 Thread Buzz Hill
Thanks. Turned out to be a bad driver. Got the update and everything works as 
expected.

- Original Message 
From: Nikki Locke <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Thursday, December 7, 2006 4:30:15 AM
Subject: Re: [sqlite] Using ODBC with Microsoft Access

Buzz Hill wrote:
> I am trying to pull records from a Microsoft Access db using
> ODBC. 
..
> The problem I am having is with
> dates. Something as simple as: 
>  
> SELECT *  FROM CostingHeader
> where DeliveryDate  = '2/6/2004' 

Access has its own unique syntax for dates (surrounded with # and
in mm/dd/ format, I think). However, I have a feeling it will accept 
Ansi standard date format in a quoted string ('2004-02-06' for a date or 
'2004-02-06T12:02:02' for s date with time (the T is important).

-- 
Nikki Locke, Trumphurst Ltd.  PC & Unix consultancy & programming
http://www.trumphurst.com/



-
To unsubscribe, send email to [EMAIL PROTECTED]
-







Re: [sqlite] Unicode Help

2006-12-07 Thread Nuno Lucas

On 12/7/06, Da Martian <[EMAIL PROTECTED]> wrote:

Ok, that does answer one of my questions I think. If I passed something not
in UTF-8 to sqlite would it return it exactly the same way I passed it in?
From your statement of chaos below I assume it wont if that data somehow
violates UTF-8. So I need to get it to UTF-8 or UTF16 before I insert.


SQLite doesn't care much about what you feed it (remember you can also
have BLOB's in fields), so if you feed it invalid UTF-8, it's invalid
UTF-8 you get on return.

The problem is when you then do do things like "SELECT length("")", or many other text operations. Then you get wrong
results.

The biggest problem is when the database generated by your program is
then read by UTF-8 aware programs (which should be all, but
unfortunely they are not). An example could be an SQLite
importer/exporter program, or some SQLite replicator program you get
on the net and generates bad data because your data wasn't good in the
first place.

Also, i you want to hand edit your data with any of the many good
SQLite GUI's, you may have problems.

If you want to go the simple way (and only do Windows), then use the
UTF-16 functions and forget about all this. As an advantage, windows
NT internals uses Unicode, so you may have some performance gains in
some places (even if negligible most of the time).


Regards,
~Nuno Lucas

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Searching for data

2006-12-07 Thread Dan Baker

I do this in the following way:

SELECT * FROM tbl WHERE
(cola LIKE '%hello%' OR colb LIKE '%hello%' OR colc LIKE '%hello%')
AND
(cola LIKE '%juan%' OR colb LIKE '%juan%' OR colc LIKE '%juan%')
AND
(cola LIKE '%casa%' OR colb LIKE '%casa%' OR colc LIKE '%casa%')

This will return all records that have every word in them somewhere.

DanB


- Original Message - 
From: "jose isaias cabrera" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, December 07, 2006 3:55 PM
Subject: [sqlite] Searching for data




Greetings.

I have a table with many columns.  I would like to find records 
google-like on all the records.  Say, for example the searching criteria 
is


hello juan casa

I would like to have any record that has all of those tokens in any of the 
columns.


how would I do that with a select?  (imagine the table has cola, colb, 
colc.)


thanks,

josé 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Searching for data

2006-12-07 Thread RB Smissaert
How about simply:

WHERE cola LIKE '%hello%juan%casa%' OR colb LIKE '%hello%juan%casa%'

Etc.

RBS


-Original Message-
From: jose isaias cabrera [mailto:[EMAIL PROTECTED] 
Sent: 07 December 2006 22:55
To: sqlite-users@sqlite.org
Subject: [sqlite] Searching for data


Greetings.

I have a table with many columns.  I would like to find records google-like
on all the records.  Say, for example the searching criteria is

hello juan casa

I would like to have any record that has all of those tokens in any of the
columns.

how would I do that with a select?  (imagine the table has cola, colb,
colc.)

thanks,

josé



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Interbase to SQLite

2006-12-07 Thread RB Smissaert
Now do you reckon with D I could move data fast from Interbase to SQLite?

RBS

-Original Message-
From: jose isaias cabrera [mailto:[EMAIL PROTECTED] 
Sent: 07 December 2006 22:31
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Interbase to SQLite


I would suggest the Programming Language D, my friend. :-)

http://www.digitalmars.com/d/index.html

The easiest and fastest language ever.  Here is an example on how to use it 
with sqlite:

http://www.dprogramming.com/enticeaddrbook.html

you will have to go to the d forums and ask for help, but I am just giving 
you the easiest and a more  powerful way than VB/VBA.

Enjoy your new found programming language.


- Original Message - 
From: "RB Smissaert" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 07, 2006 5:11 PM
Subject: RE: [sqlite] Interbase to SQLite


> OK, I think I get it now.
> There is no ready made dll, but I have to write one in C or C++.
> Trouble is I only know VB/VBA, so not too easy then.
>
> RBS
>
>
> -Original Message-
> From: Fred Williams [mailto:[EMAIL PROTECTED]
> Sent: 07 December 2006 17:43
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] Interbase to SQLite
>
> well, now that you have one of the most powerful development platforms
> in the known universe installed, study up a bit (won't require much) on
> the "VCL" concept.
>
> There are VCL's available for both Interbase and SQLite.  Install them
> and sail on...  Or, if you are an old "C" coder break out the whip with
> nails embedded and slog and flog on through the relevant API's.  You
> will feel right at home :-)
>
> Fred
>
>> -Original Message-
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, December 07, 2006 10:19 AM
>> To: sqlite-users@sqlite.org
>> Subject: Re: [sqlite] Interbase to SQLite
>>
>>
>> Hi Dennis,
>>
>> I have installed the whole lot and it went very smoothly.
>> Now though I am not sure what the next step is. Were you saying there
>> was a driver to connect to both Interbase and SQLite like an
>> ODBC driver?
>> Or did you have something else in mind?
>>
>> RBS
>>
>> > RB Smissaert wrote:
>> >> Unfortunately it looks it needs installing the .NET
>> framework and J#.
>> >> I will keep it in mind, but for now that has put me off this route.
>> >>
>> >>
>> > Yes, since Turbo C++ is based on BDS 2006 which supports C# and
>> > Delphi.Net development. As a result it uses .Net to support
>> the .Net SDK
>> > in the help system used for .Net development. So the .Net
>> framework and
>> > SDK are prerequisites. I am fairly certain the IDE itself
>> (i.e. editor,
>> > project manager, compiler, etc.) does not use .Net, they
>> were just too
>> > lazy to remove the requirements for the new single language Turbo
>> > versions. In fact, I think I saw some instructions for
>> installing BDS
>> > without the .Net framework somewhere on the web, but I
>> don't know where.
>> >
>> > If you are doing straight Win32 development, and Turbo C++ only does
>> > Win32, your application will not need .Net.
>> >
>> > I'm not sure why you think you needed J#, but that is not
>> required to
>> > the best of my knowledge.
>> >
>> > Dennis Cote
>> >
>> >
>> --
>> ---
>> > To unsubscribe, send email to [EMAIL PROTECTED]
>> >
>> --
>> ---
>> >
>> >
>> >
>>
>>
>>
>>
>> --
>> ---
>> To unsubscribe, send email to [EMAIL PROTECTED]
>> --
>> ---
>>
>
>
>

> -
> To unsubscribe, send email to [EMAIL PROTECTED]
>

> -
>
>
>
>
>

-
> To unsubscribe, send email to [EMAIL PROTECTED]
>

-
> 



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Searching for data

2006-12-07 Thread jose isaias cabrera

Greetings.

I have a table with many columns.  I would like to find records google-like on 
all the records.  Say, for example the searching criteria is

hello juan casa

I would like to have any record that has all of those tokens in any of the 
columns.

how would I do that with a select?  (imagine the table has cola, colb, colc.)

thanks,

josé

RE: [sqlite] Interbase to SQLite

2006-12-07 Thread RB Smissaert
Will have a look and thanks for the tip.

RBS


-Original Message-
From: jose isaias cabrera [mailto:[EMAIL PROTECTED] 
Sent: 07 December 2006 22:31
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Interbase to SQLite


I would suggest the Programming Language D, my friend. :-)

http://www.digitalmars.com/d/index.html

The easiest and fastest language ever.  Here is an example on how to use it 
with sqlite:

http://www.dprogramming.com/enticeaddrbook.html

you will have to go to the d forums and ask for help, but I am just giving 
you the easiest and a more  powerful way than VB/VBA.

Enjoy your new found programming language.


- Original Message - 
From: "RB Smissaert" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 07, 2006 5:11 PM
Subject: RE: [sqlite] Interbase to SQLite


> OK, I think I get it now.
> There is no ready made dll, but I have to write one in C or C++.
> Trouble is I only know VB/VBA, so not too easy then.
>
> RBS
>
>
> -Original Message-
> From: Fred Williams [mailto:[EMAIL PROTECTED]
> Sent: 07 December 2006 17:43
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] Interbase to SQLite
>
> well, now that you have one of the most powerful development platforms
> in the known universe installed, study up a bit (won't require much) on
> the "VCL" concept.
>
> There are VCL's available for both Interbase and SQLite.  Install them
> and sail on...  Or, if you are an old "C" coder break out the whip with
> nails embedded and slog and flog on through the relevant API's.  You
> will feel right at home :-)
>
> Fred
>
>> -Original Message-
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, December 07, 2006 10:19 AM
>> To: sqlite-users@sqlite.org
>> Subject: Re: [sqlite] Interbase to SQLite
>>
>>
>> Hi Dennis,
>>
>> I have installed the whole lot and it went very smoothly.
>> Now though I am not sure what the next step is. Were you saying there
>> was a driver to connect to both Interbase and SQLite like an
>> ODBC driver?
>> Or did you have something else in mind?
>>
>> RBS
>>
>> > RB Smissaert wrote:
>> >> Unfortunately it looks it needs installing the .NET
>> framework and J#.
>> >> I will keep it in mind, but for now that has put me off this route.
>> >>
>> >>
>> > Yes, since Turbo C++ is based on BDS 2006 which supports C# and
>> > Delphi.Net development. As a result it uses .Net to support
>> the .Net SDK
>> > in the help system used for .Net development. So the .Net
>> framework and
>> > SDK are prerequisites. I am fairly certain the IDE itself
>> (i.e. editor,
>> > project manager, compiler, etc.) does not use .Net, they
>> were just too
>> > lazy to remove the requirements for the new single language Turbo
>> > versions. In fact, I think I saw some instructions for
>> installing BDS
>> > without the .Net framework somewhere on the web, but I
>> don't know where.
>> >
>> > If you are doing straight Win32 development, and Turbo C++ only does
>> > Win32, your application will not need .Net.
>> >
>> > I'm not sure why you think you needed J#, but that is not
>> required to
>> > the best of my knowledge.
>> >
>> > Dennis Cote
>> >
>> >
>> --
>> ---
>> > To unsubscribe, send email to [EMAIL PROTECTED]
>> >
>> --
>> ---
>> >
>> >
>> >
>>
>>
>>
>>
>> --
>> ---
>> To unsubscribe, send email to [EMAIL PROTECTED]
>> --
>> ---
>>
>
>
>

> -
> To unsubscribe, send email to [EMAIL PROTECTED]
>

> -
>
>
>
>
>

-
> To unsubscribe, send email to [EMAIL PROTECTED]
>

-
> 



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Interbase to SQLite

2006-12-07 Thread jose isaias cabrera


I would suggest the Programming Language D, my friend. :-)

http://www.digitalmars.com/d/index.html

The easiest and fastest language ever.  Here is an example on how to use it 
with sqlite:


http://www.dprogramming.com/enticeaddrbook.html

you will have to go to the d forums and ask for help, but I am just giving 
you the easiest and a more  powerful way than VB/VBA.


Enjoy your new found programming language.


- Original Message - 
From: "RB Smissaert" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, December 07, 2006 5:11 PM
Subject: RE: [sqlite] Interbase to SQLite



OK, I think I get it now.
There is no ready made dll, but I have to write one in C or C++.
Trouble is I only know VB/VBA, so not too easy then.

RBS


-Original Message-
From: Fred Williams [mailto:[EMAIL PROTECTED]
Sent: 07 December 2006 17:43
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] Interbase to SQLite

well, now that you have one of the most powerful development platforms
in the known universe installed, study up a bit (won't require much) on
the "VCL" concept.

There are VCL's available for both Interbase and SQLite.  Install them
and sail on...  Or, if you are an old "C" coder break out the whip with
nails embedded and slog and flog on through the relevant API's.  You
will feel right at home :-)

Fred


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, December 07, 2006 10:19 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Interbase to SQLite


Hi Dennis,

I have installed the whole lot and it went very smoothly.
Now though I am not sure what the next step is. Were you saying there
was a driver to connect to both Interbase and SQLite like an
ODBC driver?
Or did you have something else in mind?

RBS

> RB Smissaert wrote:
>> Unfortunately it looks it needs installing the .NET
framework and J#.
>> I will keep it in mind, but for now that has put me off this route.
>>
>>
> Yes, since Turbo C++ is based on BDS 2006 which supports C# and
> Delphi.Net development. As a result it uses .Net to support
the .Net SDK
> in the help system used for .Net development. So the .Net
framework and
> SDK are prerequisites. I am fairly certain the IDE itself
(i.e. editor,
> project manager, compiler, etc.) does not use .Net, they
were just too
> lazy to remove the requirements for the new single language Turbo
> versions. In fact, I think I saw some instructions for
installing BDS
> without the .Net framework somewhere on the web, but I
don't know where.
>
> If you are doing straight Win32 development, and Turbo C++ only does
> Win32, your application will not need .Net.
>
> I'm not sure why you think you needed J#, but that is not
required to
> the best of my knowledge.
>
> Dennis Cote
>
>
--
---
> To unsubscribe, send email to [EMAIL PROTECTED]
>
--
---
>
>
>




--
---
To unsubscribe, send email to [EMAIL PROTECTED]
--
---





-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Interbase to SQLite

2006-12-07 Thread RB Smissaert
OK, I think I get it now.
There is no ready made dll, but I have to write one in C or C++.
Trouble is I only know VB/VBA, so not too easy then.

RBS


-Original Message-
From: Fred Williams [mailto:[EMAIL PROTECTED] 
Sent: 07 December 2006 17:43
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] Interbase to SQLite

well, now that you have one of the most powerful development platforms
in the known universe installed, study up a bit (won't require much) on
the "VCL" concept.

There are VCL's available for both Interbase and SQLite.  Install them
and sail on...  Or, if you are an old "C" coder break out the whip with
nails embedded and slog and flog on through the relevant API's.  You
will feel right at home :-)

Fred

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 07, 2006 10:19 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Interbase to SQLite
>
>
> Hi Dennis,
>
> I have installed the whole lot and it went very smoothly.
> Now though I am not sure what the next step is. Were you saying there
> was a driver to connect to both Interbase and SQLite like an
> ODBC driver?
> Or did you have something else in mind?
>
> RBS
>
> > RB Smissaert wrote:
> >> Unfortunately it looks it needs installing the .NET
> framework and J#.
> >> I will keep it in mind, but for now that has put me off this route.
> >>
> >>
> > Yes, since Turbo C++ is based on BDS 2006 which supports C# and
> > Delphi.Net development. As a result it uses .Net to support
> the .Net SDK
> > in the help system used for .Net development. So the .Net
> framework and
> > SDK are prerequisites. I am fairly certain the IDE itself
> (i.e. editor,
> > project manager, compiler, etc.) does not use .Net, they
> were just too
> > lazy to remove the requirements for the new single language Turbo
> > versions. In fact, I think I saw some instructions for
> installing BDS
> > without the .Net framework somewhere on the web, but I
> don't know where.
> >
> > If you are doing straight Win32 development, and Turbo C++ only does
> > Win32, your application will not need .Net.
> >
> > I'm not sure why you think you needed J#, but that is not
> required to
> > the best of my knowledge.
> >
> > Dennis Cote
> >
> >
> --
> ---
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
> --
> ---
> >
> >
> >
>
>
>
>
> --
> ---
> To unsubscribe, send email to [EMAIL PROTECTED]
> --
> ---
>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Interbase to SQLite

2006-12-07 Thread RB Smissaert
> study up a bit (won't require much) on the "VCL" concept

Will do that.

RBS

-Original Message-
From: Fred Williams [mailto:[EMAIL PROTECTED] 
Sent: 07 December 2006 17:43
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] Interbase to SQLite

well, now that you have one of the most powerful development platforms
in the known universe installed, study up a bit (won't require much) on
the "VCL" concept.

There are VCL's available for both Interbase and SQLite.  Install them
and sail on...  Or, if you are an old "C" coder break out the whip with
nails embedded and slog and flog on through the relevant API's.  You
will feel right at home :-)

Fred

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 07, 2006 10:19 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Interbase to SQLite
>
>
> Hi Dennis,
>
> I have installed the whole lot and it went very smoothly.
> Now though I am not sure what the next step is. Were you saying there
> was a driver to connect to both Interbase and SQLite like an
> ODBC driver?
> Or did you have something else in mind?
>
> RBS
>
> > RB Smissaert wrote:
> >> Unfortunately it looks it needs installing the .NET
> framework and J#.
> >> I will keep it in mind, but for now that has put me off this route.
> >>
> >>
> > Yes, since Turbo C++ is based on BDS 2006 which supports C# and
> > Delphi.Net development. As a result it uses .Net to support
> the .Net SDK
> > in the help system used for .Net development. So the .Net
> framework and
> > SDK are prerequisites. I am fairly certain the IDE itself
> (i.e. editor,
> > project manager, compiler, etc.) does not use .Net, they
> were just too
> > lazy to remove the requirements for the new single language Turbo
> > versions. In fact, I think I saw some instructions for
> installing BDS
> > without the .Net framework somewhere on the web, but I
> don't know where.
> >
> > If you are doing straight Win32 development, and Turbo C++ only does
> > Win32, your application will not need .Net.
> >
> > I'm not sure why you think you needed J#, but that is not
> required to
> > the best of my knowledge.
> >
> > Dennis Cote
> >
> >
> --
> ---
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
> --
> ---
> >
> >
> >
>
>
>
>
> --
> ---
> To unsubscribe, send email to [EMAIL PROTECTED]
> --
> ---
>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Interbase to SQLite

2006-12-07 Thread Ralf Junker

>Were you saying there was a driver to connect to both Interbase 

dbExpress. The Delphi help has all the details.

>and SQLite like an ODBC driver?

DISQLite3 (http://www.yunqa.de/delphi/sqlite3/) gives direct access to SQLite, 
using the original SQLite API as you know it. Component wrappers or TDataSet 
descendants are available, too. 


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Interbase to SQLite

2006-12-07 Thread Fred Williams
well, now that you have one of the most powerful development platforms
in the known universe installed, study up a bit (won't require much) on
the "VCL" concept.

There are VCL's available for both Interbase and SQLite.  Install them
and sail on...  Or, if you are an old "C" coder break out the whip with
nails embedded and slog and flog on through the relevant API's.  You
will feel right at home :-)

Fred

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 07, 2006 10:19 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Interbase to SQLite
>
>
> Hi Dennis,
>
> I have installed the whole lot and it went very smoothly.
> Now though I am not sure what the next step is. Were you saying there
> was a driver to connect to both Interbase and SQLite like an
> ODBC driver?
> Or did you have something else in mind?
>
> RBS
>
> > RB Smissaert wrote:
> >> Unfortunately it looks it needs installing the .NET
> framework and J#.
> >> I will keep it in mind, but for now that has put me off this route.
> >>
> >>
> > Yes, since Turbo C++ is based on BDS 2006 which supports C# and
> > Delphi.Net development. As a result it uses .Net to support
> the .Net SDK
> > in the help system used for .Net development. So the .Net
> framework and
> > SDK are prerequisites. I am fairly certain the IDE itself
> (i.e. editor,
> > project manager, compiler, etc.) does not use .Net, they
> were just too
> > lazy to remove the requirements for the new single language Turbo
> > versions. In fact, I think I saw some instructions for
> installing BDS
> > without the .Net framework somewhere on the web, but I
> don't know where.
> >
> > If you are doing straight Win32 development, and Turbo C++ only does
> > Win32, your application will not need .Net.
> >
> > I'm not sure why you think you needed J#, but that is not
> required to
> > the best of my knowledge.
> >
> > Dennis Cote
> >
> >
> --
> ---
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
> --
> ---
> >
> >
> >
>
>
>
>
> --
> ---
> To unsubscribe, send email to [EMAIL PROTECTED]
> --
> ---
>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Interbase to SQLite

2006-12-07 Thread bartsmissaert
Hi Dennis,

I have installed the whole lot and it went very smoothly.
Now though I am not sure what the next step is. Were you saying there
was a driver to connect to both Interbase and SQLite like an ODBC driver?
Or did you have something else in mind?

RBS

> RB Smissaert wrote:
>> Unfortunately it looks it needs installing the .NET framework and J#.
>> I will keep it in mind, but for now that has put me off this route.
>>
>>
> Yes, since Turbo C++ is based on BDS 2006 which supports C# and
> Delphi.Net development. As a result it uses .Net to support the .Net SDK
> in the help system used for .Net development. So the .Net framework and
> SDK are prerequisites. I am fairly certain the IDE itself (i.e. editor,
> project manager, compiler, etc.) does not use .Net, they were just too
> lazy to remove the requirements for the new single language Turbo
> versions. In fact, I think I saw some instructions for installing BDS
> without the .Net framework somewhere on the web, but I don't know where.
>
> If you are doing straight Win32 development, and Turbo C++ only does
> Win32, your application will not need .Net.
>
> I'm not sure why you think you needed J#, but that is not required to
> the best of my knowledge.
>
> Dennis Cote
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>
>




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: creating own pragmas

2006-12-07 Thread Günter Greschenz



Christian Smith schrieb:

Dennis Cote uttered:


Igor Tandetnik schrieb:

G�nter Greschenz <[EMAIL PROTECTED]> wrote:

i'm using "sqlite3_create_function()" to create own functions in my
database.
this is a really nice possibility to extend the database with 
powerful

functions.
but i did not find a way to create own pragmas like "pragma foo=bar"
to pass some global information to my application.


Pass global information from where? Why would your application use 
such

a roundabout way to pass global information to itself? If you need to
store some global settings in the database, why not just create a 
table

for them?


Gunter,

Igor is right, you should store your password in a table. If you are 
concerned about the password being saved in the database, then you 
could use a temporary table, or even attach a :memory: database to 
hold the table that contains the password. In any case the saved 
password is available to your encrypt and decrypt functions.



Or, even define a custom function to set the password:
SELECT set_password('password');


yes, sounds like a portable solution.
until now i patched the pragma-code (was just 3 lines), because i think 
its much more elegant to use,

but to avoid sqlite-source-ipdate-problems, i'll implement this too.
thanks !



HTH
Dennis Cote



Christian


--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \


-
To unsubscribe, send email to [EMAIL PROTECTED]
-


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: creating own pragmas

2006-12-07 Thread Christian Smith

Dennis Cote uttered:


Igor Tandetnik schrieb:

G�nter Greschenz <[EMAIL PROTECTED]> wrote:

i'm using "sqlite3_create_function()" to create own functions in my
database.
this is a really nice possibility to extend the database with powerful
functions.
but i did not find a way to create own pragmas like "pragma foo=bar"
to pass some global information to my application.


Pass global information from where? Why would your application use such
a roundabout way to pass global information to itself? If you need to
store some global settings in the database, why not just create a table
for them?


Gunter,

Igor is right, you should store your password in a table. If you are 
concerned about the password being saved in the database, then you could use 
a temporary table, or even attach a :memory: database to hold the table that 
contains the password. In any case the saved password is available to your 
encrypt and decrypt functions.



Or, even define a custom function to set the password:
SELECT set_password('password');




HTH
Dennis Cote



Christian


--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \
-
To unsubscribe, send email to [EMAIL PROTECTED]
-

Re: [sqlite] a question about muticonnection

2006-12-07 Thread Christian Smith

Mario Frasca uttered:


Christian Smith wrote:

You can use the rowid to track the row version, and a unique constraint on 
your key to track conflicts. When updating a record, read the row, 
including the rowid. Update any columns.


When writing the row out, delete the existing rowid, then insert the new 
updated row, all within a transaction.


If noone has updated the row since you read it, the delete should delete 
one row and the insert should succeed. If someone else has updated the row 
using this protocol, the delete should delete no rows, and the insert 
should fail with a unique constraint violation on your key.


maybe I'm missing something, but how does this behave if the row is updated a 
second time in the meanwhile (something like C acting as B between A-read and 
A-write)?  I've the impression that the insert will not fail...



If the row is subsequently updated, it doesn't matter, as the original row 
I based my record on has vanished due to the first update. My delete will 
delete no rows, and my insert will fail if the key clashes with an updated 
record.


Basically, I'm using the rowid as a row version number, and assuming it 
is monotonically increasing (though not necessarily correctly.) The key 
identifies the unique record.


It's a way of detecting conflicts, not preventing them. SQL UPDATE, OTOH, 
is atomic and thus prevents conflicts.





just a doubt...

regards,
MF


Christian

--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Interbase to SQLite

2006-12-07 Thread Dennis Cote

RB Smissaert wrote:

Unfortunately it looks it needs installing the .NET framework and J#.
I will keep it in mind, but for now that has put me off this route.

  
Yes, since Turbo C++ is based on BDS 2006 which supports C# and 
Delphi.Net development. As a result it uses .Net to support the .Net SDK 
in the help system used for .Net development. So the .Net framework and 
SDK are prerequisites. I am fairly certain the IDE itself (i.e. editor, 
project manager, compiler, etc.) does not use .Net, they were just too 
lazy to remove the requirements for the new single language Turbo 
versions. In fact, I think I saw some instructions for installing BDS 
without the .Net framework somewhere on the web, but I don't know where.


If you are doing straight Win32 development, and Turbo C++ only does 
Win32, your application will not need .Net.


I'm not sure why you think you needed J#, but that is not required to 
the best of my knowledge.


Dennis Cote

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] a question about muticonnection

2006-12-07 Thread Mario Frasca

Christian Smith wrote:

You can use the rowid to track the row version, and a unique 
constraint on your key to track conflicts. When updating a record, 
read the row, including the rowid. Update any columns.


When writing the row out, delete the existing rowid, then insert the 
new updated row, all within a transaction.


If noone has updated the row since you read it, the delete should 
delete one row and the insert should succeed. If someone else has 
updated the row using this protocol, the delete should delete no rows, 
and the insert should fail with a unique constraint violation on your 
key.


maybe I'm missing something, but how does this behave if the row is 
updated a second time in the meanwhile (something like C acting as B 
between A-read and A-write)?  I've the impression that the insert will 
not fail...


just a doubt...

regards,
MF

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] a question about muticonnection

2006-12-07 Thread Christian Smith

hongdong uttered:


I just have a base question:
assume user A and user B now both connection to a same database and both of
them want to update a  same record,but only one is allowed
in  this condition:
A begin to browse the data in a client application,and load rowid into GUI
and keep it in memory.
B update the record which A want to update
A now used the id stored in memory to update the same record
now it's wrong.
anyone can give me advice how to avoid this and keep the operation is
effient



You can use the rowid to track the row version, and a unique constraint on 
your key to track conflicts. When updating a record, read the row, 
including the rowid. Update any columns.


When writing the row out, delete the existing rowid, then insert the new 
updated row, all within a transaction.


If noone has updated the row since you read it, the delete should delete 
one row and the insert should succeed. If someone else has updated the row 
using this protocol, the delete should delete no rows, and the insert 
should fail with a unique constraint violation on your key.




thanks!



Christian

--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Unicode Help

2006-12-07 Thread Da Martian

Hi


You seem really confused about the whole encoding issue.


Yes definatly confused, I had always hope unicode would simplify the world,
but my experiences have shown no such luck :-) Codepages haunted my past and
encodings haunt my future :-)

Ok, that does answer one of my questions I think. If I passed something not
in UTF-8 to sqlite would it return it exactly the same way I passed it in?

From your statement of chaos below I assume it wont if that data somehow

violates UTF-8. So I need to get it to UTF-8 or UTF16 before I insert.

Thanks for the information.


Re: [sqlite] Re: Unicode Help

2006-12-07 Thread Da Martian

I am still having issues trying to get my charaters standardizsed. I spent
> all of yesterday playing with ideas but it still in the dark.

Whatever you were doing the first time was fine:



I have been having that very thought!


So if I look at a name with umlaughts in the database via sqlite3.exe I
get:
>
> Städt. Klinikum Neunkirchen gGmbH
>   --
>   |
>   an "a" with two dots on top

That text was properly encoded as UTF-8.  The ONLY issue with that
line is that the sqlite shell under Windows is incapable of displaying
Unicode, so you need to retrieve the data from sqlite using a tool
that is.  The actual storage of it is perfect.



I know the console sqlite3 wont show it. The delphi control I am using does
unicode.



> If I add the text using the *16 prepare and then retrieve it using the
*16
> column_text, I still get the two seperate characters instead of the
umlaught
> thingie. So I can only assume that somehow my source isnt UTF-16. or I
am
> converting it somewhere in the middle. This is possible since I am using
> Delphi and it has some implicit convertions, but I think I have got that
> under control.

AFAIK Delphi has no built-in Unicode support at all; you will need to
find third-party support for everything, from processing to display
controls.  It is likely you are ending up with UTF-8 data at some
point in the pipeline, and whatever you're doing to process it does
not understand UTF-8.



Yeah I am currently using VirtualTree from Mikes Delphi Gems. Its fully
unicode enabled (I beleive). I use WideStrings through out the entire
pipeline from xml I recieve into SQLite via the prepare16 back out through
column_text16 into virtual tree. Well thats true, the SQL APIs are mapped to
return PWideChar which is then copied via System.Move into a widestring as
follows:


Show code :)


* DLL *
function  sqlite3_open(filename: PWideChar; var db: pointer): integer;
cdecl; external 'sqlite3.dll' name 'sqlite3_open16';
function  sqlite3_close(db: pointer): integer; cdecl; external 'sqlite3.dll
';
function  sqlite3_exec(db: pointer; sql: PWideChar; callback: pointer;
userdata: PWideChar; var errmsg: PWideChar): integer; cdecl; external '
sqlite3.dll' name 'sqlite3_exec16';
procedure sqlite3_free(ptr: PWideChar); cdecl; external 'sqlite3.dll';
function  sqlite3_prepare(db: pointer; sql: PWideChar; nBytes: integer; var
stmt: pointer; var ztail: PWideChar): integer; cdecl; external 'sqlite3.dll'
name 'sqlite3_prepare16';
function  sqlite3_column_bytes(stmt: pointer; col: integer): integer; cdecl;
external 'sqlite3.dll' name 'sqlite3_column_bytes16';
function  sqlite3_column_text(stmt: pointer; col: integer): PWideChar;
cdecl; external 'sqlite3.dll' name 'sqlite3_column_text16';

*CLASS*
function TSqliteQueryResults.FieldAsString(i: integer): WideString;
var
   size: integer;
 temp: PWideChar;
begin
   size := FieldSize(i);
   SetLength(result, size div 2);
 temp := sqlite3_column_text(Fstmt, i);
   System.Move(sqlite3_column_text(Fstmt, i)^, PWideChar(result)^, size);
end;

function TSqliteQueryResults.FieldSize(i: integer): integer;
begin
   result := sqlite3_column_bytes(Fstmt, i);
end;

* END 

Previously (before my langauge headaches :-)  ) I was doing the above
without the APIs ending in 16, and everything was string and PChar in the
above layer. The layer that used this class has always had "WideString".

I realise your probably not delphi pros, but if you do spot something stupid
I am doing I would appreciate any help you can offer.

Thanks,


Re: [sqlite] Unicode Help

2006-12-07 Thread drh
"Da Martian" <[EMAIL PROTECTED]> wrote:
> When using the
> NON16 version of prepare:
>   If I add text which is in UTF16 what happens?
> 
> 16 Version:
> If I add UTF16 text what happnes?
> if I add UTF-8 Text what happens?
> if I add ASCIII text what happnes?
> 

You seem really confused about the whole encoding issue.

Unless you take specific actions to make it otherwise,
SQLite stores all text internally as UTF-8.  I assume
that is what you are doing, but it really does not matter
because the API works exactly the same regardless of how
SQLite stores the text internally.

All text inputs to SQLite are expected to be UTF-8,
or in the case of sqlite3...16() routines, UTF-16.
No exceptions.  SQLite never accepts text encoded
using a microsoft codepage.

If you send UTF-16 or some goofy microsoft codepage
to an SQLite API that expects UTF-8, then you will end
up with chaos.  If you send UTF-8 or a codepage into
one of the sqlite3...16() APIs, then you will end up
with chaos.  Don't do these things.

Hand most SQLite APIs UTF-8 text. Send the SQLite APIs 
that end in "16" UTF-16 text.  Do any format conversions
ahead of time.

If you just follow those simple rules, everything will
work.
--
D. Richard Hipp  <[EMAIL PROTECTED]>



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Unicode Help

2006-12-07 Thread Trevor Talbot

On 12/7/06, Da Martian <[EMAIL PROTECTED]> wrote:


I am still having issues trying to get my charaters standardizsed. I spent
all of yesterday playing with ideas but it still in the dark.


Whatever you were doing the first time was fine:


So if I look at a name with umlaughts in the database via sqlite3.exe I get:

Städt. Klinikum Neunkirchen gGmbH
  --
  |
  an "a" with two dots on top


That text was properly encoded as UTF-8.  The ONLY issue with that
line is that the sqlite shell under Windows is incapable of displaying
Unicode, so you need to retrieve the data from sqlite using a tool
that is.  The actual storage of it is perfect.


Part of my problem is I dont have a clue what my source data is encoded as.
Does anyone know of a tool which can try and guess the encoding? Basically
its a custom java bean written by someone else. It takes reports from a
third party system turns them into XML using a string buffer. They just
append everything to a string buffer. The code which actually adds this to
the output (the key peice) I cant actually see at this point. So by my best
guess based on research is that java usually uses UTF-16. But if this is so,
it should work.


It sounds as though it is UTF-16 and working fine.


If I add the text using the *16 prepare and then retrieve it using the *16
column_text, I still get the two seperate characters instead of the umlaught
thingie. So I can only assume that somehow my source isnt UTF-16. or I am
converting it somewhere in the middle. This is possible since I am using
Delphi and it has some implicit convertions, but I think I have got that
under control.


AFAIK Delphi has no built-in Unicode support at all; you will need to
find third-party support for everything, from processing to display
controls.  It is likely you are ending up with UTF-8 data at some
point in the pipeline, and whatever you're doing to process it does
not understand UTF-8.


The problem is if I copy my source and paste it into Notepad say, it shows
correctly cause notepad then does it own stuff, and if I save the notepad
and read that it works fine. *sigh*.


Notepad does support Unicode in various encodings, but that doesn't
mean anything in this test, since your system codepage may well
support the characters you're testing with anyway.


2)
When using the
NON16 version of prepare:
 If I add text which is in UTF16 what happens?



16 Version:
If I add UTF16 text what happnes?
if I add UTF-8 Text what happens?
if I add ASCIII text what happnes?


The answers to these depend on exactly how you're interfacing with it
(what programming language, how the sqlite library functions are
defined/declared, any use of library tools or auto-conversion
semantics in the language, etc).  Show code :)


Re: [sqlite] Re: Unicode Help

2006-12-07 Thread Da Martian

I think std function for convertions would be very helpful.

I am still having issues trying to get my charaters standardizsed. I spent
all of yesterday playing with ideas but it still in the dark.

Part of my problem is I dont have a clue what my source data is encoded as.
Does anyone know of a tool which can try and guess the encoding? Basically
its a custom java bean written by someone else. It takes reports from a
third party system turns them into XML using a string buffer. They just
append everything to a string buffer. The code which actually adds this to
the output (the key peice) I cant actually see at this point. So by my best
guess based on research is that java usually uses UTF-16. But if this is so,
it should work.

If I add the text using the *16 prepare and then retrieve it using the *16
column_text, I still get the two seperate characters instead of the umlaught
thingie. So I can only assume that somehow my source isnt UTF-16. or I am
converting it somewhere in the middle. This is possible since I am using
Delphi and it has some implicit convertions, but I think I have got that
under control.

The problem is if I copy my source and paste it into Notepad say, it shows
correctly cause notepad then does it own stuff, and if I save the notepad
and read that it works fine. *sigh*.

So my questions  are:

1) Any tools to determine encoding based on datas?
2)
When using the
NON16 version of prepare:
 If I add text which is in UTF16 what happens?

16 Version:
If I add UTF16 text what happnes?
if I add UTF-8 Text what happens?
if I add ASCIII text what happnes?

Thanks,


Re: [sqlite] Using ODBC with Microsoft Access

2006-12-07 Thread Nikki Locke
Buzz Hill wrote:
> I am trying to pull records from a Microsoft Access db using
> ODBC. 
..
> The problem I am having is with
> dates. Something as simple as: 
>  
> SELECT *  FROM CostingHeader
> where DeliveryDate  = '2/6/2004' 

Access has its own unique syntax for dates (surrounded with # and
in mm/dd/ format, I think). However, I have a feeling it will accept 
Ansi standard date format in a quoted string ('2004-02-06' for a date or 
'2004-02-06T12:02:02' for s date with time (the T is important).

-- 
Nikki Locke, Trumphurst Ltd.  PC & Unix consultancy & programming
http://www.trumphurst.com/



-
To unsubscribe, send email to [EMAIL PROTECTED]
-