Solved

Which Refence to add to VBA MSAccess 2010 - SQLCommand

Posted on 2014-12-06
3
230 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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

705 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

19 Experts available now in Live!

Get 1:1 Help Now