mikelcid
New Member
Hi all!
First I will show you my code, build using OpenEdge 10.2B:
Well, what I am doing in it is taking a table from my db and modifying the labels because the sentence apply in the query-prepare statement joins the tables and then, after giving the query to the bindingsource, it is given to a DevExpress control that if finds two fields with the same label it only shows one of them.
My problem is that this code works fines, I take the data with "tablename.fieldname" format but it is totally empty, it only has the structure. I have tried to use BUFFER-COPY and COPY-TEMP-TABLE statements but it does not work. I also tried to do it not using the temp-tables, directly using buffers to db but the DevExpress control didn't get the changes in the labels.
Somebody can guess where is the problem that causes the query to be empty and how to fill it?
Thanks in advance!
First I will show you my code, build using OpenEdge 10.2B:
Code:
METHOD PUBLIC VOID crearQuery(INPUT sentencia AS CHARACTER, OUTPUT bindingSource1 AS Progress.Data.BindingSource):
DEFINE VARIABLE hTable AS HANDLE NO-UNDO.
DEFINE VARIABLE iField AS INTEGER NO-UNDO.
DEFINE VARIABLE hBrowse AS HANDLE NO-UNDO.
DEFINE VARIABLE hQuery AS HANDLE NO-UNDO.
DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO.
DEFINE VARIABLE bufer AS HANDLE NO-UNDO.
CREATE QUERY hQuery.
FOR EACH tt_lininf NO-LOCK BY tt_lininf.secuencial_lin:
tt_bd = tt_lininf.tabla_lin.
CREATE TEMP-TABLE tabla.
tabla:CREATE-LIKE(tt_bd).
tabla:TEMP-TABLE-PREPARE(tt_bd).
DO iField = 1 TO tabla:DEFAULT-BUFFER-HANDLE:NUM-FIELDS:
tabla:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD(iField):COLUMN-LABEL = tt_bd + "." + tabla:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD(iField):COLUMN-LABEL.
tabla:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD(iField):LABEL = tt_bd + "." + tabla:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD(iField):LABEL.
END.
CREATE BUFFER hBuffer FOR TABLE tabla.
hQuery:ADD-BUFFER(hBuffer).
END.
hQuery:QUERY-PREPARE(sentencia).
bindingSource1 = NEW Progress.Data.BindingSource(hQuery).
RETURN.
END METHOD.
Well, what I am doing in it is taking a table from my db and modifying the labels because the sentence apply in the query-prepare statement joins the tables and then, after giving the query to the bindingsource, it is given to a DevExpress control that if finds two fields with the same label it only shows one of them.
My problem is that this code works fines, I take the data with "tablename.fieldname" format but it is totally empty, it only has the structure. I have tried to use BUFFER-COPY and COPY-TEMP-TABLE statements but it does not work. I also tried to do it not using the temp-tables, directly using buffers to db but the DevExpress control didn't get the changes in the labels.
Somebody can guess where is the problem that causes the query to be empty and how to fill it?
Thanks in advance!