Page 1 of 3
Error proyect Sqlite
Posted: Mon Jul 05, 2010 3:48 pm
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/
Re: Error proyect Sqlite
Posted: Mon Jul 05, 2010 4:28 pm
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.
Re: Error proyect Sqlite
Posted: Mon Jul 05, 2010 4:40 pm
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.
Re: Error proyect Sqlite
Posted: Mon Jul 05, 2010 4:56 pm
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
Re: Error proyect Sqlite
Posted: Wed Jul 07, 2010 4:11 am
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
Re: Error proyect Sqlite
Posted: Wed Jul 07, 2010 5:34 am
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")

Re: Error proyect Sqlite
Posted: Wed Jul 07, 2010 9:41 am
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
Thanks in advance.
Re: Error proyect Sqlite
Posted: Wed Jul 07, 2010 10:04 am
by Rathinagiri
Well. Let us try that too.

Re: Error proyect Sqlite
Posted: Wed Jul 07, 2010 10:20 am
by sudip
rathinagiri wrote:Well. Let us try that too.

YESSSS

Re: Error proyect Sqlite
Posted: Thu Jul 08, 2010 5:40 am
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