How to turn a StringGrid component into a DBStringGrid so that it works without problems with MS SQL Server?
It is known that StringGrid allows StringGrid to access the value of each cell using for i...do , but the DBGrid component cannot. Question: how to add a property in StringGrid to connect to the database table of MS SQL Server 2008? I really hope for your hint. I work in Delphi 7.
Object Table TStringGrid Property ColCount = 2 The procedure for pressing the "Calculate" button on a form is something like this:
procedure TForm1.BitBtn1Click(Sender: TObject); var i, j, neis, rez : Integer; tmp : Currency; begin q := 0; for i := 1 to Table.RowCount -1 do begin for j := 1 to Table.ColCount -1 do begin if Table.Cells[j, i] = '' then Table.Cells[j, i] := '0'; Application.ProcessMessages; end; end; for i := 1 to Table2.RowCount -1 do begin for j := 1 to Table2.ColCount -1 do begin if Table2.Cells[j, i] = '' then Table2.Cells[j, i] := '0'; Application.ProcessMessages; sleep(10); end; end;