By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

Run a script to alter a column in a table?

P: n/a
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.
Thanks.

Feb 20 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
mi****@excite.com 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-----
Feb 20 '06 #2

P: n/a

MGFoster wrote:
mi****@excite.com 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?

Feb 21 '06 #3

P: n/a
mi****@excite.com wrote:
MGFoster wrote:
mi****@excite.com 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-----
Feb 21 '06 #4

P: n/a
> -----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-----


Thanks!

Feb 23 '06 #5

P: n/a
> -----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-----


Thanks!

Feb 23 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.