Re: Run a script to alter a column in a table?



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-----
.



Relevant Pages

  • Re: How to protect Python source from modification
    ... They can then execute any arbitrary SQL command. ... >>SQL commands on their own database, who are you to tell them they ...
    (comp.lang.python)
  • Re: SQL commad each time I open MS Word
    ... Opening this document will run the following SQL command: ... information from a database -for example, if your document is a form letter ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Trouble w/ create table sql on mx.ODBC
    ... I can't get the 'create table' sql command to work. ... (ignore the geoprocessor object for ArcGIS): ... or does the program complete without any apparent change to the database? ... It might be because Access doesn't automatically commit DDL changes like some other databases do. ...
    (comp.lang.python)
  • Re: Database searching via asp/vbscript
    ... For your SQL command check out the LIKE command ... > I've created a database that holds information about a netowrk. ... > holds all the computers details such as hardware installed (including ... > administrator user. ...
    (microsoft.public.scripting.vbscript)
  • Re: Problem with "while/fetchrow_array"
    ... The first returns the last database in the known world as a row. ... I'm not sure if mysql has a mysql-only sql command you can give to get ... and execute it without any error ...
    (perl.dbi.users)