MattWoberts
Programmer
Hi,
I am using the well-documented method of adding records via ADO, using the addNew method (which allows me to get the id of the record I added).
My code does this:
rs.Open TableName, sConnect, adOpenDynamic, adLockOptimistic, adCmdTable
rs.AddNew
... add data ....
rs.Update
x = rs("ID")
Now, in most cases this is fine, but I have one table that has 300,000 records, and the rs.Open method takes about 5 seconds to execute!!! I can change the "adOpenKeyset" to "adOpenDynamic", and it then runs almost instantly, but I need the adOpenKeySet to enable me to get the ID of the record just added.
Can anyone shed any light on this? Is it something about my table?
Utterly baffled!
Thanks
I am using the well-documented method of adding records via ADO, using the addNew method (which allows me to get the id of the record I added).
My code does this:
rs.Open TableName, sConnect, adOpenDynamic, adLockOptimistic, adCmdTable
rs.AddNew
... add data ....
rs.Update
x = rs("ID")
Now, in most cases this is fine, but I have one table that has 300,000 records, and the rs.Open method takes about 5 seconds to execute!!! I can change the "adOpenKeyset" to "adOpenDynamic", and it then runs almost instantly, but I need the adOpenKeySet to enable me to get the ID of the record just added.
Can anyone shed any light on this? Is it something about my table?
Utterly baffled!
Thanks