Welcome! Log In Create A New Profile

Advanced

[WD27] Problem with HDeclareExternal & HExecuteSQLQuery

Posted by pao 
pao
[WD27] Problem with HDeclareExternal & HExecuteSQLQuery
July 06, 2022 11:39AM
If i run this code in WD22 everything is ok but in WD27 the error is always Error in the SQL code of the <_SOURCE_wqry_2> query. Unable to initialize the query.

Sample code:
g_equipamento is Data Source
H_FiCH is string=CompleteDir(fExeDir())
HCancelDeclaration(g_equipamento)
IF NOT HDeclareExternal(H_FiCH+"Equipamento.FIC",g_equipamento) THEN
Error("error hdeclare external "+H_FiCH,ErrorInfo())
RETURN
END
HMode(g_equipamento,hModeMulti)
HClose(g_equipamento)
HOpen(g_equipamento,hORead)

wsql is string
wqry is Data Source
wsql="select eqp_mac1,eqp_mac2,eqp_mac3,eqp_mac4 from g_equipamento"
IF NOT HExecuteSQLQuery(wqry,hQueryDefault,wsql) THEN
Error("error in HExecuteSQLQuery",ErrorInfo(errFullDetails))
RETURN
END
HReadFirst(wqry)
WHILE NOT HOut(wqry)
Trace(wqry.eqp_mac1)
HReadNext(wqry)
END
HCancelDeclaration(wqry)
HCancelDeclaration(g_equipamento)

Regards

Paulo Oliveira
pao
Re: [WD27] Problem with HDeclareExternal & HExecuteSQLQuery (SOLVED)
July 07, 2022 10:23AM
, PCSOFT told me how to solve it:
This dataSource problem is fixed by changing this option (see the attach) in the Project Description.

Please go to this page of the documentation for more details:
[doc.pcsoft.fr]

Regards

Paulo Oliveira
Attachments:
open | download - data_source.jpg (118 KB)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: