Records are inserted using SqLiteExpertPro.
The program only read datas. These tables have one index for the text and an 
other for the language, like this I have a record for French language (mine) 
and an other for english language. Many languages can be added like this.

Here is the table content in sql script


/************/
/*          */
/* Test.SQL */
/*          */
/************/

/* Begin Transaction */
begin transaction;

/* Database [F32-Serveur] */
pragma auto_vacuum=1;
pragma default_cache_size=2000;
pragma encoding='UTF-8';
pragma page_size=1024;

/* Drop table [LibLogInf] */
drop table if exists [LibLogInf];

/* Table structure [LibLogInf] */
CREATE TABLE [LibLogInf] (
  [_Index] INTEGER COLLATE BINARY DEFAULT (0),
  [_Langue] INTEGER COLLATE BINARY DEFAULT (0),
  [_Libelle] VARCHAR(255) COLLATE BINARY,
  CONSTRAINT [sqlite_autoindex_LibLogInf_1] PRIMARY KEY ([_Index] COLLATE 
BINARY ASC, [_Langue]));

/* Data [LibLogInf] */
insert into [LibLogInf] values(1, 1, 'La création d''un nouveau serveur dans 
la table des serveurs hébergés a été abandonnée.');
insert into [LibLogInf] values(1, 2, 'The user canceled the create process 
for the hosted server table.');
insert into [LibLogInf] values(2, 1, 'La création d''une connexion MySql a 
été abandonnée');
insert into [LibLogInf] values(2, 2, 'The user canceled the MySql''s 
connection creation');
insert into [LibLogInf] values(3, 1, 'Station en cours de démarrage.');
insert into [LibLogInf] values(3, 2, 'Station starting');
insert into [LibLogInf] values(4, 1, 'Connexion au serveur MySql réussie');
insert into [LibLogInf] values(4, 2, 'You are now connected to MySql 
server');


/* Commit Transaction */
commit transaction;

My query is :

SELECT LTRIM(RTRIM(_Libelle)) FROM LibLogInf WHERE ((_Index = 3) AND 
(_Langue = 1))

The debug session is at http://mathenay.com/AsmForum/Debug.jpg

The full database can be downloaded at 
http://mathenay.com/AsmForum/F32-Serveur.sql

Here is the open database code

SqLite_Init                    PROC    __lpszDatabase:LPSTR,__lpSql:Ptr 
HANDLE

                            INVOKE    PathFileExists,__lpszDatabase

                            test    eax,eax
                            jnz        @InitiOk

                                xor        eax,eax

                                stc
                                ret

                            ALIGN    16

@InitiOk :

                            INVOKE    sqlite3_open,__lpszDatabase,__lpSql

                            test    eax,eax
                            jz        @Success

                                mov        eax,__lpSql

                                INVOKE    sqlite3_errcode,DWord Ptr [eax]

                                stc
                                ret

                            ALIGN    16

@Success :

                            mov        eax,TRUE
                            clc
                            ret
SqLite_Init                    ENDP


Thanks for your help

Ph RIO
-----Message d'origine----- 
From: Black, Michael (IS)
Sent: Monday, June 13, 2011 6:45 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] A simple SELECT

Oops...sorry...you're correct...been far too long since I've done assembler.



Are we to understand that if you simply give this table a different name it 
works?

That seems to be what you said in your initial email.



Are you inserting records in the table in your assembler too?



Are you absolutly SURE the data is in the database you are opening in your 
assembler code?

Can you give us a dump of that database?  And show in your code where you 
open it?





Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate



________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Bogdan Ureche [bogdan...@gmail.com]
Sent: Monday, June 13, 2011 11:28 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] A simple SELECT

I think this line is correct as it is:

INVOKE sqlite3_prepare_v2,__hSql,__lpszQuery,-1,eax,edx

The second parameter is __lpszQuery (the text of the query UTF-8 encoded).
The statement handle is returned at the address stored in eax and is
subsequently used when calling sqlite3_step.


Bogdan Ureche


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to