GRID - OnQueryData
Moderator: Rathinagiri
GRID - OnQueryData
Hi All
I'm trying to change data source from DBF to postgresql using (virtual grid)
I have connection to postgresql via RDD.
Source of data is result of the query.
oQuery:- .....
aTable:=PQRESULT2ARRAY(oQuery:pQuery)
Function onsqlquery
This.QueryData := aTable[This.QueryRowIndex] [This.QueryColIndex]
Return Nil
In object inspector - bookmark "function" of the grid control
OnQueryData onsqlquery()
All working properly.
DoubleClick on row in grid returns correct value (for example: 10)
The problem appears when i try to locate and highlight (to point) correct row in a grid assigning value.
ControlName.GridName.value:=10
Result
Date:2017.12.06 Time: 14:54:44
Error BASE/1132 Error range of array: incorect number of arguments
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from C_MSGSTOP(0)
Called from SHOWERROR(181)
Called from DEFERROR(129)
Called from (b)ERRORSYS(66)
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from C_MSGSTOP(0)
Called from SHOWERROR(181)
Called from DEFERROR(129)
Called from (b)ERRORSYS(66)
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from C_MSGSTOP(0)
Called from SHOWERROR(181)
Called from DEFERROR(129)
Called from (b)ERRORSYS(66)
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from C_MSGSTOP(0)
Called from SHOWERROR(181)
Called from DEFERROR(129)
Called from (b)ERRORSYS(66)
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5702)
Called from DOMETHOD(9003)
Called from QHASLA(16)
Called from HB_EXECFROMARRAY(0)
Called from (b)MAIN(161)
Called from _DOCONTROLEVENTPROCEDURE(6041)
Called from EVENTS(1741)
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5702)
Called from DOMETHOD(9003)
Called from QWSTEP_LOGOWANIE(273)
Called from WSTEP(712)
Called from SPLASHDELAY(1045)
Called from (b)SPLASH(4)
Called from _PROCESSINITPROCEDURE(5861)
Called from _ACTIVATEWINDOW(5689)
Called from DOMETHOD(9003)
Called from SPLASH(1035)
Called from (b)MAIN(4)
Called from _PROCESSINITPROCEDURE(5861)
Called from _ACTIVATEWINDOW(5612)
Called from DOMETHOD(9003)
Called from MAIN(631)
It is possible to point (highlight) correct row in virtual grid assigning value or other way ?
Regards/Saludos
Rafał
I'm trying to change data source from DBF to postgresql using (virtual grid)
I have connection to postgresql via RDD.
Source of data is result of the query.
oQuery:- .....
aTable:=PQRESULT2ARRAY(oQuery:pQuery)
Function onsqlquery
This.QueryData := aTable[This.QueryRowIndex] [This.QueryColIndex]
Return Nil
In object inspector - bookmark "function" of the grid control
OnQueryData onsqlquery()
All working properly.
DoubleClick on row in grid returns correct value (for example: 10)
The problem appears when i try to locate and highlight (to point) correct row in a grid assigning value.
ControlName.GridName.value:=10
Result
Date:2017.12.06 Time: 14:54:44
Error BASE/1132 Error range of array: incorect number of arguments
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from C_MSGSTOP(0)
Called from SHOWERROR(181)
Called from DEFERROR(129)
Called from (b)ERRORSYS(66)
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from C_MSGSTOP(0)
Called from SHOWERROR(181)
Called from DEFERROR(129)
Called from (b)ERRORSYS(66)
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from C_MSGSTOP(0)
Called from SHOWERROR(181)
Called from DEFERROR(129)
Called from (b)ERRORSYS(66)
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from C_MSGSTOP(0)
Called from SHOWERROR(181)
Called from DEFERROR(129)
Called from (b)ERRORSYS(66)
Called from ONSQLQUERY(1583)
Called from (b)QHASLA(425)
Called from EVENTS(3049)
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5702)
Called from DOMETHOD(9003)
Called from QHASLA(16)
Called from HB_EXECFROMARRAY(0)
Called from (b)MAIN(161)
Called from _DOCONTROLEVENTPROCEDURE(6041)
Called from EVENTS(1741)
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5702)
Called from DOMETHOD(9003)
Called from QWSTEP_LOGOWANIE(273)
Called from WSTEP(712)
Called from SPLASHDELAY(1045)
Called from (b)SPLASH(4)
Called from _PROCESSINITPROCEDURE(5861)
Called from _ACTIVATEWINDOW(5689)
Called from DOMETHOD(9003)
Called from SPLASH(1035)
Called from (b)MAIN(4)
Called from _PROCESSINITPROCEDURE(5861)
Called from _ACTIVATEWINDOW(5612)
Called from DOMETHOD(9003)
Called from MAIN(631)
It is possible to point (highlight) correct row in virtual grid assigning value or other way ?
Regards/Saludos
Rafał
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: GRID - OnQueryData
Can you post a simple sample? Without any database? Only array?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: GRID - OnQueryData
I do not know if this is will work with what you are doing.
In hmg3.44 I found the table does not follow the grid so whenever I want to set the table row to the grid row
I select the table and put in line
go ControlName.GridName.recno
this sets the table to the grid and they are in sync again
if this does not work
then maybe you have to reuse this statement ? This.QueryData := aTable[This.QueryRowIndex] [This.QueryColIndex]
In hmg3.44 I found the table does not follow the grid so whenever I want to set the table row to the grid row
I select the table and put in line
go ControlName.GridName.recno
this sets the table to the grid and they are in sync again
if this does not work
then maybe you have to reuse this statement ? This.QueryData := aTable[This.QueryRowIndex] [This.QueryColIndex]
All The Best,
Franco
Canada
Franco
Canada
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: GRID - OnQueryData
Franco, it's simple
1. access the database
2 reads rows and writes to the grid
3. then wants to change the data, insert, update or delete, and it needs to know which line changes
here is the question and structure of the table in the database
but the problem is that we only see a program fragment, not all
1. access the database
2 reads rows and writes to the grid
3. then wants to change the data, insert, update or delete, and it needs to know which line changes
here is the question and structure of the table in the database
but the problem is that we only see a program fragment, not all
Re: GRID - OnQueryData
Thanks for your answers
You're right.
Becouse this is a part of a very big working project i have to prepare sample to show the problem in short prg.
Regards
You're right.
Becouse this is a part of a very big working project i have to prepare sample to show the problem in short prg.
Regards
- serge_girard
- Posts: 3165
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: GRID - OnQueryData
Rafat,
Please try with ControlName.GridName.value:= {n ,1} where n is your index.
Serge
Please try with ControlName.GridName.value:= {n ,1} where n is your index.
Serge
There's nothing you can do that can't be done...
Re: GRID - OnQueryData
This code is right to the situation when grid has declared CellNavigation property as true...serge_girard wrote: ↑Sun Dec 10, 2017 2:19 pm Rafat,
Please try with ControlName.GridName.value:= {n ,1} where n is your index.
Serge
Without small sample it's very hard to help you, Rafał
Re: GRID - OnQueryData
Hi
I wrote a sample to show the problem.
I created database name "grid" in public shema of postgresql and the table gridtest
Host := "localhost"
Database := "grid"
User := "postgres"
Passwd := "postgres"
CREATE TABLE public.gridtest
(
id integer NOT NULL DEFAULT nextval('gridtest_id_seq'::regclass),
name character varying(100)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.gridtest
OWNER TO postgres;
I added 3 records and run sample and ??????
Everything was fine and worked properly.
I don't know why i have a problem in my project (yet).
Maybe some variables are similar and rewrited each other.
Working sample in attachment.
Thank you all for your help.
I'm going to work.
Regards / Saludos/ Pozdrowienia
"La hora mas oscura es justo antes del amanecer"
I wrote a sample to show the problem.
I created database name "grid" in public shema of postgresql and the table gridtest
Host := "localhost"
Database := "grid"
User := "postgres"
Passwd := "postgres"
CREATE TABLE public.gridtest
(
id integer NOT NULL DEFAULT nextval('gridtest_id_seq'::regclass),
name character varying(100)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.gridtest
OWNER TO postgres;
I added 3 records and run sample and ??????
Everything was fine and worked properly.
I don't know why i have a problem in my project (yet).
Maybe some variables are similar and rewrited each other.
Working sample in attachment.
Thank you all for your help.
I'm going to work.
Regards / Saludos/ Pozdrowienia
"La hora mas oscura es justo antes del amanecer"
- Attachments
-
- GRID.ZIP
- (1.49 MiB) Downloaded 230 times
Re: GRID - OnQueryData
You must attach libeay.dll and libiconv-2.dll
Re: GRID - OnQueryData
Sometimes you need to spend whole day or week looking for small error
IMHO, if your sample works OK, you must watch over your code.