Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Altering tables in an existing database

 
   Database Help (Home) -> Visual Basic RSS
Next:  Export Excel  
Author Message
KevinEvans

External


Since: May 12, 2004
Posts: 1



(Msg. 1) Posted: Wed May 12, 2004 10:12 pm
Post subject: Altering tables in an existing database
Archived from groups: comp>lang>basic>visual>database (more info?)

I have an application 'out there' and now need to alter some tables in my
client's Access database. I can easily add (create) tables, alter tables (add
and remove fields) and drop tables all in code. However I would also like to
extend the length of an existing text field from 100 to the maximum 255
characters in a table. Can this be done in code? Any help/advice greatly
appreciated.

Second question (not so important): When I am creating a table in code I'm
having a problem adding a Boolean field. What is wrong with:

CREATE TABLE [tbName] (field1 text(50), field2 boolean)

Kevin Evans
KLE

 >> Stay informed about: Altering tables in an existing database 
Back to top
Login to vote
Alan Barker

External


Since: Jun 01, 2004
Posts: 3



(Msg. 2) Posted: Tue Jun 01, 2004 7:36 pm
Post subject: Re: Altering tables in an existing database [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

firstly,
to alter a column in a table execute the following (using access' SQL query
type set to Data Definition)

alter table [tbname]
alter column [tfield] text(255)

this extends (or truncates) the tfield to 255

Secondly,
try changing the boolean (SQL) type to the dumbed down access type (yesno)

CREATE TABLE [tbName] (field1 text(50), field2 yesno)

hope this helps
al.


"KevinEvans" <kevinevans.TakeThisOut@aol.com> wrote in message
news:20040512151212.28864.00001268@mb-m05.aol.com...
 > I have an application 'out there' and now need to alter some tables in my
 > client's Access database. I can easily add (create) tables, alter tables
(add
 > and remove fields) and drop tables all in code. However I would also like
to
 > extend the length of an existing text field from 100 to the maximum 255
 > characters in a table. Can this be done in code? Any help/advice greatly
 > appreciated.
 >
 > Second question (not so important): When I am creating a table in code I'm
 > having a problem adding a Boolean field. What is wrong with:
 >
 > CREATE TABLE [tbName] (field1 text(50), field2 boolean)
 >
 > Kevin Evans
 > KLE<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Altering tables in an existing database 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
I need help with some VB or SQL programming for a database. - I need some VB or SQL coding to finish up an access database program. I am trying to choose selected records from an access table based on certain criteria. Example: 2 records needed out of 4 total records and the code should choose the 2 records with...

Shared Database Connection? - I want to use an oracle odbc connection on my windows server for an application I am writing for client workstations. The result is I don't want to install the oracle client to get sql*net on every workstation i am running my the program on. What shoul...

Package &amp; Deployment wizard: Update a database - Dear, I have developed a standalone VB6.0 application which uses an access database. I deployed this application with the "Package & Deployment"-wizard from Visual Basic, and it works fine. Due to some new requirements I had to add an ext...

Create a database when a user logs in for the first time - Hi, Looking for some ideas ? ADO / RDO ? I need to develope a visual basic application that when a user launches the application it checks to see if the datase for the user is created if the user does not have a DATABASE it creates one then creates a...

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]