Click to See Complete Forum and Search --> : SQL via code to change a field type in an existing DB


leeshadmi
November 19th, 2006, 05:27 AM
Hi
I have an Access database and its contain some tables in it with values.
I need to change one field that is now define as Text [250] to Memo type

There are records with values in this tables.
I need to do it via VB.Net 2003

What is the SQL line and is it going to delete the records data or damage the database in any wasy?

thanks :wave:

Shuja Ali
November 20th, 2006, 01:31 AM
Did you try using the Alter Table script. I guess it should work with Access although I am not sure. But you can stil try it out. Alter Table TABLENAME {Alter Column COLUMN1 Memo} I haven't tried it though.

leeshadmi
November 20th, 2006, 06:01 AM
No my friend as far as i try its not working
Alter command as far as i read in the help files is for add,rename and more... but not to change a Column type from ont to another.

if i am wrong then please let me know cuz for now i stuck with the program.
:cry:

Shuja Ali
November 20th, 2006, 06:12 AM
No I guess that is possible as long as the data present in the field can be converted to new data type. And in your case it just a Text field that you are trying to change to Memo field.

The data will not be lost.