I'm importing text files that were exported from Access. Some included the identity field and some did not. So I need to know which files have identity fields in them.
(The text files do not have all the fields that are in the SQL tables.)
The problem with this code is that the field type does not have a property called "Identity"
Can someone suggest another way of determining, in Access, if a particular field is an identity field?
Thank you
Leon
(The text files do not have all the fields that are in the SQL tables.)
Code:
Dim cnn as new adodb.connection
Dim rs as new adodb.recordset
Dim fld As Field
set cnn = currentproject.connection
rs.open "MyTable", cnn, adOpenForwardOnly, adLockReadOnly
For each fld in rs.fields
if fld.Identity then
docmd.runsql "SET IDENTITY_INSERT MyTable ON"
end if
next
...
Can someone suggest another way of determining, in Access, if a particular field is an identity field?
Thank you
Leon