Change an Access query from VB code

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.
Thanks
Mark.
markevans100Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NetworkArchitekCommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jkwassonCommented:
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...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/admscadoapireference.asp

hope this helps,
jk
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.