Re: Run a script to alter a column in a table?
- From: MGFoster <me@xxxxxxxxxxx>
- Date: Tue, 21 Feb 2006 03:51:33 GMT
minjie@xxxxxxxxxx wrote:
MGFoster wrote:
minjie@xxxxxxxxxx wrote:
Is it possible to run a simple script to alter a table column in Access
database from an interger to a double? I have been writing C++ programs
every time we need to upgrade (modify) the Access database, but found
it cumbersome. I know I can change database definition via Access GUI
interface itself, but if the database is at a remote site, and if I
don't want the users to mess around with the database by themselves,
then I have to implement the modification with a script or a program
and just ask them to run it.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You can use DDL. You'll need a statement like this (Access 2002
ANSI92):
ALTER TABLE <table name> ALTER COLUMN <column name> DOUBLE
Run this as if it were a regular SQL command.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQ/pKboechKqOuFEgEQI0hgCg2QqOie8Ok//gbiYMcZSTNR1XlCcAoNG3
ilbaSkmXx9d+cdyQSjwjswEN
=t5w6
-----END PGP SIGNATURE-----
Thanks for the reply!
For running the SQL command like that, I need to open the Access
database, and somehow copy that statement into the Queries section as a
query, and run it, right? Is there a way to do it by not opening the
Access?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Yes. Use ADO. That's why I said "Run this as if it were a regular SQL
command." Use the adCmdText in the Connection's Execute method:
cnx.Execute "ALTER TABLE <table name> ALTER COLUMN <column name>
DOUBLE",, adCmdText
or, however it is set up in C++.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQ/qOOoechKqOuFEgEQI0ygCfc2hk7xKqPCwAy5GN1QsnjIg/ztMAoM/E
FRgBz7Rn0Po2rzCjtOmRmBSf
=VYuR
-----END PGP SIGNATURE-----
.
- Follow-Ups:
- Re: Run a script to alter a column in a table?
- From: minjie
- Re: Run a script to alter a column in a table?
- From: minjie
- Re: Run a script to alter a column in a table?
- References:
- Run a script to alter a column in a table?
- From: minjie
- Re: Run a script to alter a column in a table?
- From: MGFoster
- Re: Run a script to alter a column in a table?
- From: minjie
- Run a script to alter a column in a table?
- Prev by Date: Re: pause "on current"
- Next by Date: Re: I am a beginner
- Previous by thread: Re: Run a script to alter a column in a table?
- Next by thread: Re: Run a script to alter a column in a table?
- Index(es):
Relevant Pages
|