|
Data not being placed in consecutive rows
Author |
Message |
news.verizon.ne #1 / 4
|
 Data not being placed in consecutive rows
Hi Group I have the code below working thanks to one of the forum experts. I`ve run into a strange problem. When I open the access table to view the data. I see the first row is blank. My data is placed in the second row. It seems the data is not being placed in consecutive rows. I wondering what I screwed up to cause this condition. Example 1st row black, second row data, third row blank, then data again Thanks as always. procedure TfrmDrw.suiButton2Click(Sender: TObject); begin if not (MaterialTable.State in [dsInsert]) then MaterialTable.Insert; with MaterialTable do begin FieldByName('MatJoint').Value := dbcboJointTypeSelect.Text; FieldByName('MatStockType').Value := cboMatType.Text; FieldByName('MatPartName').Value := dbcboPartName.Text; FieldByName('MatSpecies').Value := dbcboSpecSolid.Text; FieldByName('MatRoughThkSolid').Value := dbedtRghThkSolid.Text; FieldByName('MatFinishThkSolid').Value := dbedtFinThickSolid.Text; FieldByName('MatBdftCostSolid').Value := dbedtCostBdftSolid.Text; FieldByName('MatWasteSolid').Value := dbedtPriceSqftSheet.Text; Post; end; end; end.
|
Tue, 29 Nov 2005 03:36:36 GMT |
|
 |
Dan #2 / 4
|
 Data not being placed in consecutive rows
How are you putting the data into the table? It sounds like you may be doing an Insert, which creates the blank line, and then AppendRecord, which adds another record with the data. HTH, Dan On Thu, 12 Jun 2003 19:36:36 GMT, "news.verizon.net" Quote:
>Hi Group >I have the code below working thanks to one of the forum experts. I`ve run >into >a strange problem. When I open the access table to view the data. I see the >first row is blank. My data is placed in the second row. It seems the data >is >not being placed in consecutive rows. I wondering what I screwed up to cause >this condition. Example 1st row black, second row data, third row blank, >then data again >Thanks as always. >procedure TfrmDrw.suiButton2Click(Sender: TObject); >begin > if not (MaterialTable.State in [dsInsert]) then > MaterialTable.Insert; > with MaterialTable do > begin > FieldByName('MatJoint').Value := dbcboJointTypeSelect.Text; > FieldByName('MatStockType').Value := cboMatType.Text; > FieldByName('MatPartName').Value := dbcboPartName.Text; > FieldByName('MatSpecies').Value := dbcboSpecSolid.Text; > FieldByName('MatRoughThkSolid').Value := dbedtRghThkSolid.Text; > FieldByName('MatFinishThkSolid').Value := dbedtFinThickSolid.Text; > FieldByName('MatBdftCostSolid').Value := dbedtCostBdftSolid.Text; > FieldByName('MatWasteSolid').Value := dbedtPriceSqftSheet.Text; > Post; > end; >end; >end.
|
Tue, 29 Nov 2005 03:55:00 GMT |
|
 |
news.verizon.ne #3 / 4
|
 Data not being placed in consecutive rows
The below procedure is the technique I`m using to place the data in the db. There is a navigator control also. Would having that control in addition to my procedure cause a conflict. I don`t have a clue. Quote: > How are you putting the data into the table? It sounds like you may be > doing an Insert, which creates the blank line, and then AppendRecord, > which adds another record with the data. > HTH, > Dan > On Thu, 12 Jun 2003 19:36:36 GMT, "news.verizon.net"
> >Hi Group > >I have the code below working thanks to one of the forum experts. I`ve run > >into > >a strange problem. When I open the access table to view the data. I see the > >first row is blank. My data is placed in the second row. It seems the data > >is > >not being placed in consecutive rows. I wondering what I screwed up to cause > >this condition. Example 1st row black, second row data, third row blank, > >then data again > >Thanks as always. > >procedure TfrmDrw.suiButton2Click(Sender: TObject); > >begin > > if not (MaterialTable.State in [dsInsert]) then > > MaterialTable.Insert; > > with MaterialTable do > > begin > > FieldByName('MatJoint').Value := dbcboJointTypeSelect.Text; > > FieldByName('MatStockType').Value := cboMatType.Text; > > FieldByName('MatPartName').Value := dbcboPartName.Text; > > FieldByName('MatSpecies').Value := dbcboSpecSolid.Text; > > FieldByName('MatRoughThkSolid').Value := dbedtRghThkSolid.Text; > > FieldByName('MatFinishThkSolid').Value :=
dbedtFinThickSolid.Text; Quote: > > FieldByName('MatBdftCostSolid').Value :=
dbedtCostBdftSolid.Text; Quote: > > FieldByName('MatWasteSolid').Value := dbedtPriceSqftSheet.Text; > > Post; > > end; > >end; > >end.
|
Tue, 29 Nov 2005 04:04:51 GMT |
|
 |
Dan #4 / 4
|
 Data not being placed in consecutive rows
On Thu, 12 Jun 2003 20:04:51 GMT, "news.verizon.net" Quote:
>The below procedure is the technique I`m using to place the data >in the db. There is a navigator control also. Would having that >control in addition to my procedure cause a conflict. I don`t have >a clue.
The navigator can insert a blank line, but it will depend on how it is used and set up. If you don't force the selected row past the last data row, I doubt if it is causing this. I presume this is a live TTable or TQuery connected to the db. Are you using CachedUpdates? Is AutoEdit true in the datasource? (allows the dbgrid to insert a blank row) I would set a breakpoint to step thru the whole process of adding a row to make sure that it isn't doing something strange like running twice, once with data, onece without. HTH, Dan
|
Sat, 03 Dec 2005 06:33:09 GMT |
|
|
|