Solved

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

Posted on 2001-07-18
6
198 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now