Solved

How to change a text type column length in an access2000 table using ado progamitacilly within vb6

Posted on 2012-03-30
4
399 Views
Last Modified: 2012-06-27
I need to know if there is a way to change a text field (column) in an access2000 mdb using ado from within a vb6 program, and if so I need some help in composing the code to accomplish this.

Thanks for your help here.
0
Comment
Question by:morrisbo
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 37789861
you can use
currentdb.execute "alter table tableName alter column ColumnName Text(255)"  

that will set the column length to 255
0
 

Author Comment

by:morrisbo
ID: 37789915
Thanks capricorn1,

I am just a novice vb6  programmer.

The data base name is Acord. Its path is C:\appfolder\acord.mdb.

Was wondering what coding will  get me from that path to currentdb.execute.

Really appreciate your help.

morrisbo
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 37790170
You can't use Currentdb with ADO, but Cap1's SQL command is the statement you need to execute.

See this example -

http://www.functionx.com/vb6/Lesson16.htm
0
 

Author Comment

by:morrisbo
ID: 37792391
peter57r

Thanks,

That is the code example I needed with ADO ub VB6 program.  Works just fine.

morrisbo
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

839 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