Delete record using ADODC in vb6
-
Experts i have mostly figured out the code i need howevr am slightly stuck! I have a database which works fine, i want to delete a record that i have highlighted, code :
dim lbk as long
lbk = Adodc2.recordset.bookmark
Adodc2.refresh
Adodc2.recordset.move lbk
Adodc2.recordet.deleteThis code will delete the last record and not the record selected :( Im sure that there is something little in this code which isn't working, if anybody can help that would be great Cheers Dan
-
Experts i have mostly figured out the code i need howevr am slightly stuck! I have a database which works fine, i want to delete a record that i have highlighted, code :
dim lbk as long
lbk = Adodc2.recordset.bookmark
Adodc2.refresh
Adodc2.recordset.move lbk
Adodc2.recordet.deleteThis code will delete the last record and not the record selected :( Im sure that there is something little in this code which isn't working, if anybody can help that would be great Cheers Dan
-
offroaderdan wrote:
Adodc2.recordset.move lbk
should be :
Adodc2.recordset.bookmark = lbk
Are you sure the type of
lbk
islong
?Thanks for that. However it comes up with run time error 3001, in conflict.... ummm just so i read your post write the code should go
dim lbk as long
lbk = Adodc2.Recordset.bookmark ' same as below
Adodc2.refresh
Adodc2.recordset.bookmark = lbk ' this is near enough repeated
adodc2.recordset.deleteThanks again for the reply :) and yeah i am sure that lbk is long as it will delete a record but not the one i want!
-
Thanks for that. However it comes up with run time error 3001, in conflict.... ummm just so i read your post write the code should go
dim lbk as long
lbk = Adodc2.Recordset.bookmark ' same as below
Adodc2.refresh
Adodc2.recordset.bookmark = lbk ' this is near enough repeated
adodc2.recordset.deleteThanks again for the reply :) and yeah i am sure that lbk is long as it will delete a record but not the one i want!