Change an Access query from VB code

Posted on 2005-03-30
Medium Priority
Last Modified: 2010-04-17
I need to change a query in an Access 2002 database from VB6 code. I'm using ADODB but can't figure out how to change the query. If you also know how to create tables and change table structures that would be great.
Question by:markevans100
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 10

Accepted Solution

NetworkArchitek earned 1000 total points
ID: 13668883
I haven't done much ADODB (just ADO.NET) but to create tables and change tables in Access through VB6 or any language you can just use standard SQL stuff. If you execute a query from VB with the commandtext = "CREATE TABLE TEST .." it will create the table or if you use "ALTER TABLE" it will change the table. Access accepts standard SQL stuff. There may be other ways  but I stick with SQL.

As for as changing Access' internal queries through ADODB, I don't know that one. But hopefully the other stuff gave you some ideas.

Assisted Solution

jkwasson earned 1000 total points
ID: 13669018
You want to use the ADOX object model to mainpulate table structures, etc. I think (but am not positive) that you may be able to change the sql on a stored proc using ADOX. For more info, follow the link...


hope this helps,

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Introduction to Processes

762 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