Solved

Which Refence to add to VBA MSAccess 2010 - SQLCommand

Posted on 2014-12-06
3
234 Views
Last Modified: 2014-12-06
I need to DIM a variable like
DIM CMD as New SQLCommand
the 'SQLCommand' option is not available in intilsense, I am guessing that is because the necessary refernce is missing. Have tried add a few and can get every SQLxxxx but the one I want ie SQLCommand.

All guidance really appreciated.
0
Comment
Question by:downehouse
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 40484467
That's a .Net thing. In VBA it's:

Dim dbs As DAO.Database
Dim strSQL As String

Set dbs = CurrentDb
strSQL = "your SQL string to execute"

dbs.Execute strSQL

/gustav
0
 

Author Closing Comment

by:downehouse
ID: 40484474
Thanks for quick reply, will save a fews hours!!
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40484476
You are welcome!

/gustav
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

20 Experts available now in Live!

Get 1:1 Help Now