DELETE IN External DB

G

Guest

I think you have the position correct, just not the syntax.

DeleteSql = "DELETE * FROM tblPay IN 'C:\RED\Reddy.mdb' " _
& "WHERE tblPay.PayNameID=" _
& [Forms]![frmBSCouponNames]![TxtID]
DoCmd.RunSQL (DeleteSql)

You could also use:
Currentdb.execute DeleteSQL, dbfailonerror

This latter method does not provide warnings indicating the number of
records about to be deleted though.

HTH
Dale
 
D

DS

Kinda like Suspicious SQL but this is DELETE...

DeleteSql = "DELETE * FROM tblPay IN '" & C:\RED\Reddy.mdb & "' " & _
"WHERE (((tblPay.PayNameID)=[Forms]![frmBSCouponNames]![TxtID]));"
DoCmd.RunSQL (DeleteSql)

Where does the IN part go?
Thanks
DS
 
D

DS

DS said:
Kinda like Suspicious SQL but this is DELETE...

DeleteSql = "DELETE * FROM tblPay IN '" & C:\RED\Reddy.mdb & "' " & _
"WHERE (((tblPay.PayNameID)=[Forms]![frmBSCouponNames]![TxtID]));"
DoCmd.RunSQL (DeleteSql)

Where does the IN part go?
Thanks
DS
Got It.
DeleteSql = "DELETE * FROM table1 IN '" & REDACT() & "' " & _
"WHERE (((table1.IDNumber)=1));"
DoCmd.RunSQL (DeleteSql)
DS
 
D

DS

Dale said:
I think you have the position correct, just not the syntax.

DeleteSql = "DELETE * FROM tblPay IN 'C:\RED\Reddy.mdb' " _
& "WHERE tblPay.PayNameID=" _
& [Forms]![frmBSCouponNames]![TxtID]
DoCmd.RunSQL (DeleteSql)

You could also use:
Currentdb.execute DeleteSQL, dbfailonerror

This latter method does not provide warnings indicating the number of
records about to be deleted though.

HTH
Dale
Thanks,Dale
dbFailonerror means what?
DS
 
G

Guest

dbFailOnError causes Access to throw an error when it encounters an error in
the Execute method. Without this parameter, Access will drive on without
generating an error, so you think it did the deletion, when in actuallity, it
didn't.

HTH

--
Email address is not valid.
Please reply to newsgroup only.


DS said:
Dale said:
I think you have the position correct, just not the syntax.

DeleteSql = "DELETE * FROM tblPay IN 'C:\RED\Reddy.mdb' " _
& "WHERE tblPay.PayNameID=" _
& [Forms]![frmBSCouponNames]![TxtID]
DoCmd.RunSQL (DeleteSql)

You could also use:
Currentdb.execute DeleteSQL, dbfailonerror

This latter method does not provide warnings indicating the number of
records about to be deleted though.

HTH
Dale
Thanks,Dale
dbFailonerror means what?
DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top