Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ALTER TABLE - ADD COLUMN long integer

Status
Not open for further replies.

toetag

MIS
Sep 27, 2002
166
US
I've been trying to add (with script) a column to an access database. with the below script i can get the column added, but i can't adjust it's type:

ALTER TABLE archived ADD COLUMN arch_path NUMBER;

According to:


I just have to add the FIELD SIZE to get the appropriate number type. ("Set the FieldSize property to define the specific Number type. 1, 2, 4, or 8 bytes. 16 bytes for Replication ID (GUID) only.")

Rather dumb question, but what would the field size be for LONG INTEGER. What would I need to put in the (fieldsize)?

Thank you in advance for helping a troubled mind.
 
How many numbers are you looking to store?!

Unfortunately access can only use the types suggested (SQL server is a lot more flexible, but we'll work with what we've got ;D)

Suggested work around is to use the text field... but you'd need to use the CLng() function in any expressions that refer to this field.

------------------------
Hit any User to continue
 
i'm going to be storing any where from 1 - 2,000,000,000 in the field. I don't believe I can use text as the field will be calculated later on and having to always convert to long each time it's calculated, might be troublesome later on.

I'm just being lazy and don't want to have to open up the database every time (i'm creating about 200 of these for a conversion) and manually add that one field to a table.
 
Have you tried this ?
ALTER TABLE archived ADD COLUMN arch_path LONG;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top