-
Deleting a record
This query works fine...
SELECT exp.ID AS [REC_ID], exp.date AS [Date], cat.description AS Category, est.name AS Establishment, Choose(exp.payment+1,'Cash','Credit Card','Check') AS [Payment Mode],
Choose(exp.payment+1,crd.company,'N/A','N/A') AS [Credit Card], exp.amount AS Amount
FROM tblCreditCards AS crd RIGHT JOIN (tblCategories AS cat RIGHT JOIN (tblEstablishments AS est RIGHT JOIN tblExpenses AS exp ON est.id=exp.establishment) ON cat.id=exp.category) ON crd.id=exp.credit_card
ORDER BY exp.date;
...but why can't I delete a record from an ado recordset?
is it because of the RIGHT JOIN? or how the tables where arranged in the JOIN statement?
by the way...this is the error...
Run-time error: '-2147467259 (80004005)'
Insufficient key column information for updating or refreshing.
Thanks a lot!
-
If your SELECT works fine and the problem is with your DELETE, why post the code for your SELECT?
Perhaps if you share the code that is causing prblems it might be easier to help you with your problem.
-
DELETE FROM WHERE .. delete the record through SQL command..
greetings UNI
-
I posted the SELECT query because when I delete a record from MS Access table browser, I don't encounter errors...only on VB when I use recordset.Delete.
-
I tried the DELETE FROM WHERE and it worked!
But howcome the recordset.delete doesn't work?
-
Don't really know because I never used recordset.delete .. SQL ist a wonderful language and it is much more portable. if using ado you can just change the connection string and you can use a SQL server instead of the mdb database. or mysql etc.. so DELET FROM is always a better choise than using these built in functions.
greetings UNI