V
Vayse
I have a form bound to a dataset. The form displays an Asset. There is also
a grid on the form bound to a Schedules table, which is a Schedule for that
asset. So its very like a master/detail form.
Some questions:
1) Is it a mistake to use the Data Sources explorer for my forms? Would I be
better off to just fill the text boxes through my own code, and then write
back.
2) The AssetsDataSet that is created - is this the same dataset throughout
the project? Say I have 3 forms, frmAssets, frmCalendar, frmCustomer. Each
uses AssetsDataSet - is it the same one, or a copy each time?
3) At the moment, I am using a temporary table, TempSchedule, to show the
user what the new schedule would look like. If the user clicks Save, I
update the Schedule table with the contents of the TempSchedule table. Code
is below.
Would it be possible to do this in the dataset, without creating a temporary
table?
Thanks
Vayse
Dim stSQL As String
Dim cnnAsset As New ADODB.Connection ' Connection to the database
cnnAsset.Open(conCONNECT)
stSQL = "DELETE * FROM Schedule WHERE Sch_AssetCode = '" &
Me.txtAssetCode.Text & "'"
cnnAsset.Execute(stSQL, lRecords)
stSQL = "INSERT INTO Schedule SELECT TempSchedule.* FROM TempSchedule"
cnnAsset.Execute(stSQL, lRecords)
cnnAsset.Close()
a grid on the form bound to a Schedules table, which is a Schedule for that
asset. So its very like a master/detail form.
Some questions:
1) Is it a mistake to use the Data Sources explorer for my forms? Would I be
better off to just fill the text boxes through my own code, and then write
back.
2) The AssetsDataSet that is created - is this the same dataset throughout
the project? Say I have 3 forms, frmAssets, frmCalendar, frmCustomer. Each
uses AssetsDataSet - is it the same one, or a copy each time?
3) At the moment, I am using a temporary table, TempSchedule, to show the
user what the new schedule would look like. If the user clicks Save, I
update the Schedule table with the contents of the TempSchedule table. Code
is below.
Would it be possible to do this in the dataset, without creating a temporary
table?
Thanks
Vayse
Dim stSQL As String
Dim cnnAsset As New ADODB.Connection ' Connection to the database
cnnAsset.Open(conCONNECT)
stSQL = "DELETE * FROM Schedule WHERE Sch_AssetCode = '" &
Me.txtAssetCode.Text & "'"
cnnAsset.Execute(stSQL, lRecords)
stSQL = "INSERT INTO Schedule SELECT TempSchedule.* FROM TempSchedule"
cnnAsset.Execute(stSQL, lRecords)
cnnAsset.Close()