Solved

Resize a Field in an  Access 2.0 Table (Error 3219)

Posted on 2001-07-18
6
200 Views
Last Modified: 2012-08-13
Hello Experts:

I have a MS-Access 2.0 Database. There is a table "Customers" and a field "Description" of type text.

Now i have to resize the field from 10 to 20 characters (using vb6).

I can't execute:

MyTDef.Fields("Description").Properties("Size").Value=20

because of Error 3219.

Please don't suggest:

1. Add a new field to the fields-collection with the desired properties (and a different field name, say 'NewField')
2. Copy all data from 'Description' to 'NewField'
3. Remove 'Description' from 'Customers'
4. Rename 'NewField' to 'Description'

or something like that, because i don't want to copy any data (there are a lot of records in 'customers').

Thanks in advance :-)
0
Comment
Question by:VK
  • 3
  • 2
6 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 6294688
I take it that you do not have Access 2.0 available, so that you could simple change the design of the table in the MDB directly?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 6294749
As far as I am aware, there is NO way to ALTER the size of an existing column via the ALTER TABLE Action query in Access SQL.

JET SQL(DAO) only supports ADD COLUMN, DROP COLUMN--you cannot change the size of an existing column, nor can you change the name of an Existing Column.

Your only choice would be : Use Access 2.0 and make the requested change directly through the Database Design interface in Access 2.0

0
 
LVL 6

Author Comment

by:VK
ID: 6295444
Arthur, ty for the reply.

Yes i have Access available, but our customers have not.
I have to write a tool that has to update their databases.
So i have to initiate all jobs from vb.

Is there a way creating remote a macro in the database that can do the job ?

I don't know the DoCmd - syntaxes. Further, there may be a way doing the job via OLE.

Let's wait a day or so. If your comment still remains the best, you get the points.

:-)
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 6

Author Comment

by:VK
ID: 6295469
Arthur, ty for the reply.

Yes i have Access available, but our customers have not.
I have to write a tool that has to update their databases.
So i have to initiate all jobs from vb.

Is there a way creating remote a macro in the database that can do the job ?

I don't know the DoCmd - syntaxes. Further, there may be a way doing the job via OLE.

Let's wait a day or so. If your comment still remains the best, you get the points.

:-)
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 50 total points
ID: 6300121
You may not like the prospect of creating a new field and copying the data into that field, etc., but that is exactly what Access does, albeit behind the scenes.  So I would be very surprised (not the first time) if you find a way to dynamically alter the size without copying their contents.

My 2 cents worth.
0
 
LVL 6

Author Comment

by:VK
ID: 6301190
OK. I have no alternative.
I believe it.
Nobody here could help.

But so far, acperkins has the best description of the reason.

Thanks to Arthur too. :-)

bye
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question