Microsoft
Software
Hardware
Network
Question : db.Execute result
I'm using the following to insert a record in a table:
1: 2: 3:
sql="INSERT INTO table (Order,Quantity) VALUES ('test',10) db.execute (sql)
How can I find out the db.execute actually added a new record or not.
If the
order
field's
Index
is set to
Yes(No Duplicate)
it will fail to insert a new record if
Order
is duplicated
thanks for any kind of help
Answer : db.Execute result
Dim lRecs As Long
sql="INSERT INTO table (Order,Quantity) VALUES ('test',10)
With CurrentDb
.execute (sql)
lRecs = .RecordsAffected
End With
If lRecs>0 then ' it happened
mx
Random Solutions
DTS not running in job - SQL 2008
Protect Cell Validation
Access 2007 --- Run-time 2455: You entered an expression that has an invalid reference to the property LinkChildFields.
attachments in email msg
2008 std server not reporting in to WSUS
Using Modules in VBA to prevent repeating codes in sheets
VB.Net XML Reading
Split specific Cross tab table rows based on criteria - keeping all other column data intact.
Repaint window slowness
How to fix assignment of 'ptr to const' to 'ptr' compile error?