PDA

View Full Version : Solved: Access vs Sybase



ChloeRadshaw
06-07-2009, 06:08 AM
Ok - I admit it - I know very little about Access but am using it on a project at the moment.

I have two questions:
1) Why does Access force you to write [fieldName]???

2) have a table which I have imported data into and have specified the primary key column myself. This column contains Ids that have been generated and are not continuous. Is there any way to change this fields to AutoNumber but prevent Access from changing the Ids? Also presumably you need to tell access that the next free Id is > some number?

How is this done?

Oorang
06-10-2009, 06:30 PM
1.) In what context? In SQL you only need it if you have a space in the name otherwise you can just use table.field in formulas, I suspect it was to ease parsing.
2.) Not easily. You could import the table, copy/paste and when prompted select structure only. Change the ID to autonumber. Then generate enough dummy records to hit your highest id. Then run a delete query to remove all dummy records who don't have an ID present in the import table, then finally, run an update query to move all the none id fields into the new table turning your dummy records into real records. Delete your import table, rename your new table and set it live... Great right? :D

ChloeRadshaw
06-11-2009, 01:20 AM
Thanks - I am going to use a counter table instead.

Tks

OBP
06-11-2009, 04:34 AM
I would have kept the Imported ID field and Incremented it using VBA.
It is quite easy to do.

Oorang
06-11-2009, 07:02 AM
OBP, that is an option, but an issue you might run into with that method is you have to manually increment it for all updates. And if you are like me and do a lot of commits via SQL instead of forms that can get to be a real hassle:S