Update Query wont execute from currentdb??

P

p

I am stumped and need someone to help. We have access 2000 linked with ODBC
to sql server 2000. My retrieves some data then update Access table. I
have the select part running but the update does not run. I pasted the
update query (below) into Access and it updates the database, but does not
appear to do anything when run from my code currentdb.execute? Here is the
SQL just before execution. I have references to dao 3.6 and ado 2.1.

Insert strSQL2 = UPDATE tblReturnSnRma SET tblReturnSnRma.PECCODE =
"700212186", tblReturnSnRma.RTNSNPurchaseOrder = "21664466BJF-0730",
tblReturnSnRma.RTNSNDatePORecd = #8/12/2003#, tblReturnSnRma.RTNSNVendorName
= "COMPANYA", tblReturnSnRma.RTNSNDateInvoiced = #9/23/2003# WHERE
(tblReturnSnRma.SerialNumber = ("A31651053912")) AND
(tblReturnSnRma.RMANumber = (9))

CurrentDb.Execute strSQL2, dbFailOnError

The execute statement does not appear to do anything, but it works if I
paste this into Access update query?? What am I missing?

Thanks in advance
P
 
Z

zfidjili

p said:
I am stumped and need someone to help. We have access 2000 linked with ODBC
to sql server 2000. My retrieves some data then update Access table. I
have the select part running but the update does not run. I pasted the
update query (below) into Access and it updates the database, but does not
appear to do anything when run from my code currentdb.execute? Here is the
SQL just before execution. I have references to dao 3.6 and ado 2.1.

Insert strSQL2 = UPDATE tblReturnSnRma SET tblReturnSnRma.PECCODE =
"700212186", tblReturnSnRma.RTNSNPurchaseOrder = "21664466BJF-0730",
tblReturnSnRma.RTNSNDatePORecd = #8/12/2003#, tblReturnSnRma.RTNSNVendorName
= "COMPANYA", tblReturnSnRma.RTNSNDateInvoiced = #9/23/2003# WHERE
(tblReturnSnRma.SerialNumber = ("A31651053912")) AND
(tblReturnSnRma.RMANumber = (9))

CurrentDb.Execute strSQL2, dbFailOnError

The execute statement does not appear to do anything, but it works if I
paste this into Access update query?? What am I missing?

Thanks in advance
P
 
P

p

I think the data was not inserted yet.......

Please see
Advice needed for Updating subform datasheet
 

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