Solved

Change field data type of Access using VB6 ADO

Posted on 2010-09-14
3
1,058 Views
Last Modified: 2013-12-25
How can I change the data type of an Access database field from Autonumber to Long in VB6 and using ADO?
0
Comment
Question by:thenemesiz
  • 2
3 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 33671339
Do that by executing a DDL SQL statement, which would look like this:
"ALTER TABLE MyTable ALTER COLUMN <MyAutoNumberToChange>  LONG;"
You may find the following helpful with other SQL/DDL statements that you can use:
Intermediate Microsoft Jet SQL for Access 2000
http://msdn.microsoft.com/en-us/library/aa140015(office.10).aspx#acintsql_adovdao
JimD.

 
 
0
 

Author Comment

by:thenemesiz
ID: 33671456
bravo 'JDettman' works ok
0
 
LVL 57
ID: 33671574
Thanks.  Check out that link I posted.  Also at the bottom of that is a link to the third part of the article, advanced JET SQL which is well worth looking through.  
Between the three articles, they show you anything and everything that can be done with JET SQL.
JimD.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

919 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

19 Experts available now in Live!

Get 1:1 Help Now