Error proyect Sqlite

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

claudiotedesco
Posts: 132
Joined: Thu Jul 31, 2008 12:05 pm

Error proyect Sqlite

Post by claudiotedesco »

Hola
Quisiera saber porque me da el siguiente error el proyecto que estoy armando en SQLITE
Adjunto archivo
Gracias
Claudio


hbmk2: Processing configuration: E:\hmg\harbour\bin\hbmk.cfg
hbmk2: Processing: inicio.hbc
hbmk2: Compiling Harbour sources...
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/

E:/hmg/SAMPLES/1ejer/sqlite/datosnombre.prg(14) Error E0030 Syntax error "syntax error at '.'"

E:/hmg/SAMPLES/1ejer/sqlite/datosnombre.prg(16) Error E0030 Syntax error "syntax error at '.'"

2 errors

No code generated.
hbmk2: Error: Running Harbour compiler (embedded). 1
(E:\hmg\harbour\bin\harbour.exe) -n2 E:/hmg/SAMPLES/1ejer/sqlite/datosnombre.prg E:/hmg/SAMPLES/1ejer/sqlite/main_button_1_action.prg /q -o.hbmk\win\mingw\ -iE:/hmg/harbour/include -iE:/hmg//include -iE:/hmg/SAMPLES/1ejer/sqlite -iE:/hmg/SAMPLES/1ejer/sqlite/
Attachments
sqlite.rar
(20.71 KiB) Downloaded 455 times
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Error proyect Sqlite

Post by Rathinagiri »

Hi,

In datosnombre.prg file, you are referring a window which is not defined/activated in that file. Hence, we have to declare the same exclusively before calling any function (line no 2 after #include) as "declare window vnombre".

It has nothing to do with SQLite.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Error proyect Sqlite

Post by Rathinagiri »

I have changed the codes to show the data in the grid correctly.

Please go through and ask me if you have any doubts.
sqlite_changed.zip
(912 Bytes) Downloaded 467 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
claudiotedesco
Posts: 132
Joined: Thu Jul 31, 2008 12:05 pm

Re: Error proyect Sqlite

Post by claudiotedesco »

Hola

Te agradezco tu gentil ayuda.
Cualquier cosa te aviso ti tengo problemas muchas gracias

Claudio

Hello

I appreciate your kind help.
Any thing you will notice I have trouble thank you very much
User avatar
Steed
Posts: 427
Joined: Sat Dec 12, 2009 3:40 pm

Re: Error proyect Sqlite

Post by Steed »

Hi, all

So, there is any way to pass an entrie array to a Grid, differently of use:
for i=1 to xx
Grid1.additem({0,aCurRow})
next i

Some like: Grid1.aitems:=aCurRow, because it will be faster and easy



Regards,

Ed


Hola, todos,

Hay alguna forma de pasar un array completo a un Grid, diferente a usar:

for i=1 to xx
Grid1.additem({0,aCurRow})
next i

Algo como: Grid1.aitems:=aCurRow, porque esto seira mas rapido y facil de usar



Gracias,

Ed
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Error proyect Sqlite

Post by Rathinagiri »

We can use the following UDF for this.

Usage: setarrayitems("Form1","Grid1",aItems)

Code: Select all

function setarrayitems(cFormName,cControlName,aItems)
local i := 0
Domethod ( cFormName, cControlName , "DELETEALLITEMS")
for i := 1 to len(aItems)
   DoMethod(cFormName,cControlName,"ADDITEM",aItems[i])
next i
return nil 
If you want to use

Form1.Grid1.Items := aItems

then, you have to insert as 95th line the following in c:\hmg\include\i_window.ch

Code: Select all

    #xtranslate <w>	. \<c\> . Items := \<a\> => SetArrayItems ( <"w">, \<"c"\> , \<a\>  ) ;;
The advantage is we can use this for Grid, ListBox and ComboBox controls. :) In the case of Grid, we have to pass a two dimensional array and for others single dimensional.

So, it is very easy now to have like this:

form1.grid1.items := sql(dbo,"select name,address from personaldata order by name") :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Error proyect Sqlite

Post by sudip »

Hello Rathi and All Friends,

Have you tried Sql.prg codes with PostreSql? I tried it some months ago, but not successful ;)
If we can do this, then we can use any of 3 RDBMSs (SQLite, MySql, PGSql) without much changing existing codes :D

Thanks in advance.
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Error proyect Sqlite

Post by Rathinagiri »

Well. Let us try that too. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Error proyect Sqlite

Post by sudip »

rathinagiri wrote:Well. Let us try that too. :)
YESSSS :D
With best regards,
Sudip
User avatar
Steed
Posts: 427
Joined: Sat Dec 12, 2009 3:40 pm

Re: Error proyect Sqlite

Post by Steed »

Thanks, rathinagiri

BTW, do you know if there are any UDF_lib.prg: because, i guess, there should be others interesting functions to save time.


Regards,

Ed

Gracias, rathinagiri

A propósito, sabes si hay alguna UDF_lib.prg, porque creo que deben haber otras funciones interesantes para ahorrar tiempo.

Saludos,

Ed
Post Reply