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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chage Data Type in Table with code??? HELP!!!!!!

Status
Not open for further replies.

FiberIce

IS-IT--Management
May 21, 2002
4
US
Chage the data type of a field in a table I'm creating on the fly with a Db.Execute (strSQL). I either need to change the datatype in the SQL code that I put into strSQL string or right after I create the table. I can't find anything on writing this change into the sql string, and I looked at the createtabledef command and that isn't intended for this.
So any ideas? Anyone? Anyone?
 
I'm not sure I understand how you are doing this. If you are creating a table, then you have to create the fields also, so what prevents you from making the field the datatype you want right from the start. I'm sure there's a reason but you don't really give too many details in your post. One thought is to wait till after you've created the table and other fields and then create this one field using the CreateFieldMethod. You would append it to the Table you want, and choose the Datatype as part of the argument.

Paul
 
Ok I figured it out. All I need to do is put and int() around the data to make it a number data type.

Sorry to bug you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top