Unanswered: Using Sql to Deletie a Record When ADO is Used
I am currently using Visual Basic 6 to write a Tax Computation Program.
I created a Database with one Table in Microsoft Access that ships with Office 2000. The name of the Database is "Tax", and the name of the Table is "PAYE".
I then usedcActiveX Data Control (ADO) to connect the Text Box controls on the Form to the Table. I have the following fields in the Table and the Form: Assessment Year, Tax Payer ID, Name, Address, Basic Salary, Other Allowances, Gross Pay, Tax Free Pay, Taxable Pay, Annual tax Payable and Monthly Tax payable.
I also have the following command buttons on the Form: Add, Delete, Save, and Close.
All the command buttons work perfectly with the exception of the Delete button. Each time I run the program and click the Delete button I get the following error Message:
"Runtime Error - 2147217887(80040e21).
Multiple step operation generated errors. Check each status."
Please I want you to give me Sql statement that will delete any Tax Payer's record whenever the user wants to delete a record from the Table.
If I the user cannot delete a record from the Table my program will not be complete. In fact my program will be useless. Iam worried about this.
are any other tables related to the paye table? If a foreign key relationship exists on other tables, you would first need to delete the related records, THEN delete the current record.
BTW. It's generally more effective (as well as kinder to your database) to use data objects in your code, rather than data controls. Especially since ADO data controls are bound to ADO v2.1 (and ADO 2.8 is current.)
You might also want to look at the database installments here
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert