MS Access Conversion (1 Viewer)

wh00t

Registered User.
Local time
Today, 08:47
Joined
May 18, 2001
Messages
264
Happy new year all!

I am currently working on creating an MS Access > SQL conversion script for our customers to use, the conversion will be run on machines using runtime access so they can not use the upsizing wizard.

The script works correctly making it very easy for the users to convert to SQL, but I have just one problem, I need to keep the same autonumber values in the converted tables, I believe I need to issue the 'SET IDENTITY_INSERT ON' command to the SQL server, but I'm stuck on how to do that from within MS Access.
 

wh00t

Registered User.
Local time
Today, 08:47
Joined
May 18, 2001
Messages
264
well that was easy enough (Used 'oDatabase.ExecuteImmediate "SET IDENTITY_INSERT " & tdf.Name & " ON"') But I'm stuck on 1 more thing.

Not all tables have an Identity field and error on the above code if it does not, so i need to see if a table has an Identity value before setting the IDENTITY_INSERT, I can get this from within SQL using 'Select OBJECTPROPERTY(object_id('table_name'), 'TableHasIdentity')' But I don't know how I can retrieve the value from within access, can anyone help with this part?
 

Users who are viewing this thread

Top Bottom