Hi,
I am unsuccessfully trying to delete all underlying records in a 'back-end' Access 97 database table (Stock) using the SQL 'DELETE' command. I have the following code attached to the click event of a command button on a VB Stock Data Entry / Modification Form:
datstockReorder.RecordSource = "DELETE * FROM [tblStock]"
The DAO control 'datStockReorder' is a Dynaset type recordset and its Read Only property is False. The Access table has had all it' s relational links removed, so is 'Stand Alone', avoiding any potential JOIN pitfalls. I have tried using datStockReOrder.Refresh, datStockReOrder.Update and the 'EDIT' methods, but these return errors.
The recordset is linked to a dBGRid. This WILL successfully display records based on SQL syntax SELECT FROM WHERE etc... Can the DELETE approach be used in this way with VB recordsets. I have tried to reduce part of a more complex solution to the above to try to make progress.
Hope you can shed a little light on this frustrating problem.
Many thanks in anticipation.
Hafod
I am unsuccessfully trying to delete all underlying records in a 'back-end' Access 97 database table (Stock) using the SQL 'DELETE' command. I have the following code attached to the click event of a command button on a VB Stock Data Entry / Modification Form:
datstockReorder.RecordSource = "DELETE * FROM [tblStock]"
The DAO control 'datStockReorder' is a Dynaset type recordset and its Read Only property is False. The Access table has had all it' s relational links removed, so is 'Stand Alone', avoiding any potential JOIN pitfalls. I have tried using datStockReOrder.Refresh, datStockReOrder.Update and the 'EDIT' methods, but these return errors.
The recordset is linked to a dBGRid. This WILL successfully display records based on SQL syntax SELECT FROM WHERE etc... Can the DELETE approach be used in this way with VB recordsets. I have tried to reduce part of a more complex solution to the above to try to make progress.
Hope you can shed a little light on this frustrating problem.
Many thanks in anticipation.
Hafod