Programatically change a Number field to a Text field

  • Thread starter Thread starter Chris O''Neill
  • Start date Start date
C

Chris O''Neill

I have a back end database with a table that has a number field that I want
to change to a text field. In searching this forum, I found an example using
a DDL "Alter Table" query but that example looks like it applies to a table
in the current database, not an external database.

Can someone provide me with sample code for changing a field in an external
database with these assumptions:

Database Name: mydatabase.mdb
Admin UID: DBAdmin
Admin PWD: Password
Table Name: tblBadTable
Field Name: NumberField
Current Field Type: Long
Desired Field Type: Text (25)

If I can get a generic example using the above assumptions, I can modify it
to suit my needs.

Thanks, in advance, for any help provided.

Regards, Chris
 
The DDL is exactly the same: you just need to use OpenDatabase
instead of CurrentDB.

(david)
 
Back
Top