mikemcginty
Programmer
Is it true that I cannot add a new record when .cursorlocation = adUseClient?
What is the difference between the two then?
The code below works for adUseServer but the autonumber returned is null for adUseClient
Set rsCertificates = New ADODB.Recordset
ADODBCheckConnection
Set rsCertificates.ActiveConnection = dbQADMObject
With rsCertificates
' retrieve all existing certificate records for this document
.source = "SELECT * from UtblQADM" & sCategoryTableName & _
" where fCategoryID = " & lCategoryID & _
" ORDER BY CertificateID"
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
dbQADMObject.Errors.Clear
.Open
' create the new certificate
.AddNew
' retrieve the new certificate ID (autonumber) field
' this is the next autonumber using adUseServer and null if using adUseClient
lNewCertificateID = rsCertificates ("CertificateID"
.value
Thanks
Mike
When you call out for help in the darkness, and you hear a voice in return, you're probably just talking to yourself again!
What is the difference between the two then?
The code below works for adUseServer but the autonumber returned is null for adUseClient
Set rsCertificates = New ADODB.Recordset
ADODBCheckConnection
Set rsCertificates.ActiveConnection = dbQADMObject
With rsCertificates
' retrieve all existing certificate records for this document
.source = "SELECT * from UtblQADM" & sCategoryTableName & _
" where fCategoryID = " & lCategoryID & _
" ORDER BY CertificateID"
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
dbQADMObject.Errors.Clear
.Open
' create the new certificate
.AddNew
' retrieve the new certificate ID (autonumber) field
' this is the next autonumber using adUseServer and null if using adUseClient
lNewCertificateID = rsCertificates ("CertificateID"
Thanks
Mike
When you call out for help in the darkness, and you hear a voice in return, you're probably just talking to yourself again!