change column size run time

Doron Barnea

Member
Joined
May 31, 2005
Messages
9
Programming Experience
10+
I want to change a column in MS-ACCESS from char(22) to char(100) through code.

I tried

"ALTER TABLE <table name> MODIFY <column-name> char(100)" like ansi-SQL defines.

Didn't work. Not through code and not even through MS-ACCESS itself.

Ideas ?
 
I believe you will require either DAO or ADO-X to perform MS Access data structure modifications. The other alternative is to ship a fresh clean DB that has the new structure, then run a routine that ports the data to the new DB.
 
ADOX requires deploy/install/existence of MDAC. DAO is probably already on the system, it's easy to use, but you must ensure DAO is there too! It's a tough situation if you want the smallest possible deployment! I don't know why Microsoft didn't put data structure modification capabilities in ADO.NET other than it wants to ditch MS Access and move everyone to the MS-SQL product line.
 
I think it's actually a defficiency in Access rather than ADO.NET. Doesn't every database with an actual server provide the facility to perform structural modifications through ExecuteNonQuery? I don't think Microsoft would want to create that functionality as part of ADO.NET just for Access when every other database provides it already.
 
Back
Top