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. 5 5269 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-----
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? 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-----
> -----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!
> -----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! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dylan Nicholson |
last post by:
Seems that Oracle 9.2 (using MS ODBC driver) requires extra
parentheses when adding multiple columns to a table:
ALTER TABLE MyTable ADD (MyColumn1 VARCHAR(255), MyColumn2
VARCHAR(255))
vs
...
|
by: Lannsjo |
last post by:
I need to change my primary key column type from smallint to int.
I have tried:
ALTER TABLE livegroup MODIFY id INT UNSIGNED NOT NULL AUTO_INCREMENT;
But get an error message certainly since my...
|
by: Bruce |
last post by:
Hi,
I want to change the datatype of an existing column from char to
varbinary. When I run the "Alter Table" statement, I get the
following error message -
Disallowed implicit conversion...
|
by: Neil |
last post by:
How can I create a script that updates a table with new fields without
losing the data in the table (i.e., without dropping and recreating the
table)?
Thanks.
|
by: RamaKrishna Narla |
last post by:
In MS SQL Server, I have the following tables with some data in it.
create table table1 (
column1 varchar(32),
column2 int not null,
column10 varchar(255),
.....
primary key (column1,...
|
by: Jeff_in_MD |
last post by:
Hi,
I'm trying to add a column to a table, then update that column with a
query. This is all within a single batch. Sqlcmd gives me an error on
the update, saying "invalid column xxx", because...
|
by: vasilip |
last post by:
I'm testing out db2 for a project I'm starting that requires proper xml
support and I can't seem to get both xml and spatial data to work well
in the same table.
Once having created a table...
|
by: rcamarda |
last post by:
Hello,
I need to alter fields in all my tables of a given database, and I
would to do this via a t-sql script.
Example, I want to change all fields called SESSION_ID to char(6). The
field is...
|
by: Shestine |
last post by:
I am trying to add a column to a current table, with data in it. I am only learning, and i have no idea how to change this to make it work. Here is the script I have right now it, but what it does is...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |