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
Access DoCmd.runSQL running a SQLServer stored procedure
primary ip address for a server?
Outlook 2003 Exchange 2003 - Calendar shows items in only one view not in others
Creating histogram in MINITAB 15
How to reset or change Windows server 2008 System Recovery password.
How to control growing size of an MSSQL database transaction log file
Capture bin file from Cisco ASA device
SSRS Jump to Report
Creating a list for a calculated field from a related table
How do you TRIM n characters from a string from the right.