Posts by Ramon Ruan • 1,018 points
66 posts
-
0
votes3
answers138
viewsA: Cannot capture sql error
I debugged the code one more time and found DModuleGrid.ZQuery2.Close; DModuleGrid.ZQuery2.SQL.Clear; DModuleGrid.ZQuery2.SQL.Add('SELECT * FROM tabc460 LIMIT 0, '+valor); DModuleGrid.ZQuery2.Open;…
-
-1
votes3
answers138
viewsQ: Cannot capture sql error
try DModuleGrid.ZQuery1.Close; DModuleGrid.ZQuery1.SQL.Clear; DModuleGrid.ZQuery1.SQL.Add('SELECT * FROM tdcupant'); DModuleGrid.ZQuery1.SQL.Add('WHERE numcupom = :co2 AND ccf = :cc3 AND dtcompra =…
-
0
votes2
answers888
viewsA: Format date (from a txt file) to Insert to Mysql
Follow the code I wrote based on @Caputo’s code. with DModuleGrid.ZQuery2 do begin //comparação de divergências (Identifica se sao mesmo diferentes e grava os valores no banco de dados) coo :=…
-
2
votes2
answers888
viewsQ: Format date (from a txt file) to Insert to Mysql
Follows the code: //informações necessarias para inserir no DB. coo := copy(lTemp,53,6); ccf := copy(lTemp,47,6); ecf := copy(lTemp,4,20); //Data sendo formatada para ser inserida dtc1:=…
-
1
votes1
answer245
viewsA: Comparison works, but data listing does not
Follow the code, gentlemen: procedure TfrmGrid.btnLoadCupClick(Sender: TObject); var txt: TextFile; treg, lreg, dc: integer; valortxt, valorbd : double; lTemp, valor, dtcompratxt, ccf, coo, ecf:…
delphianswered Ramon Ruan 1,018 -
0
votes1
answer245
viewsQ: Comparison works, but data listing does not
procedure TfrmGrid.btnLoadClick(Sender: TObject); var txt: TextFile; treg, lreg, dc: integer; valortxt, valorbd : double; dt1, dt2,lTemp, valor, dtcompratxt, numnf, coo,ccf: String; dtcompra:…
delphiasked Ramon Ruan 1,018 -
1
votes1
answer785
viewsQ: Optimize database query and compress code
Follows the code: procedure TfrmGrid.btnLoadClick(Sender: TObject); var txt: TextFile; treg, lreg: integer; valortxt, valorbd : double; dt1, dt2,lTemp, valor, dtcompratxt: String; dtcompra:…
delphiasked Ramon Ruan 1,018 -
1
votes2
answers369
viewsA: Compare txt data with database data
Follow the code I developed in response. I hope it helps. procedure TfrmGrid.btnLoadClick(Sender: TObject); var txt: TextFile; treg, lreg: integer; valortxt, valorbd : double; lTemp, valor,…
delphianswered Ramon Ruan 1,018 -
1
votes2
answers369
viewsQ: Compare txt data with database data
Follows the code: procedure TfrmGrid.btnLoadClick(Sender: TObject); var txt: TextFile; l,treg,treg2, coo, ccf: integer; valortxt, valorbd : double; lTemp, valor, dtcompratxt: String; dtcompra:…
delphiasked Ramon Ruan 1,018 -
1
votes2
answers142
viewsQ: Date Killing in TXT to compare with Database Date
Follows the code: dtcompra := copy(lTemp,65,2)+'-'+copy(lTemp,63,2)+'-'+copy(lTemp,58,4); if DModuleGrid.ZQuery1.ParamByName('dtcompra').AsDateTime = StrToDateTime(dtcompra) then begin //codigo end;…
delphiasked Ramon Ruan 1,018 -
2
votes1
answer108
viewsQ: How to make the user not catch an Invalid TXT?
Follows the code: procedure TfrmGrid.btnLoadClick(Sender: TObject); var txt: TextFile; l, treg : integer; lTemp: String; begin treg := 1; l:= 0; AssignFile(txt, lbCaminho.Caption); Reset(txt); while…
delphiasked Ramon Ruan 1,018 -
4
votes1
answer1818
viewsQ: Floating Point Error
Follows the code of total price that is giving floating point error`: //Pr. Total sgItens.Cells[5,l] := FormatFloat('###,###,###,##0.00',StrToFloat(copy(lTemp, 210, 14))); cont:=…
-
0
votes1
answer854
viewsQ: Recognize File . INI / Redo File . INI in case of file deletion
Follow below the code: procedure TfrmSelection.FormActivate(Sender: TObject); var ArqIni: TIniFile; begin ArqIni := ArqIni.Create('C:\sga\saga.ini'); try ZConnection1.Connected := false;…
delphiasked Ramon Ruan 1,018 -
0
votes1
answer649
viewsQ: First Stringgrid (Delphi) line information
Follows the code: procedure TfrmGrid.sgCuponsDblClick(Sender: TObject); var txt: TextFile; l, i : integer; lTemp, CFF, COO: String; begin i:=0; l:=0; CFF := sgCupons.Cells[0,sgCupons.Row]; COO :=…
delphiasked Ramon Ruan 1,018 -
0
votes1
answer1523
viewsQ: Import data from a TXT and play required positions in Stringgrid
Follow the code I developed, along with my co-worker. procedure TfrmGrid.Button1Click(Sender: TObject); var arq: TStringGrid; txt: TextFile; c, l, treg : integer; lTemp: String; begin treg := 0;…
-
3
votes1
answer2266
viewsQ: Importing data from a TXT to a Stringgrid
I have a stringgrid, and I need to import a file txt for him, however I need to take all lines according to positions, and I have no idea how to do, I did research, but without success. I need that…
delphiasked Ramon Ruan 1,018