Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
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…

577 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