View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default connect to MS SQL

The ado.ocx is an ActiveX control that needs to be licensed to be used in a
project and you , apparently, do not have that license. You should still be
able to use ADO in VBA if you add a reference to "Microsoft ActiveX Data
Objects Library" (this should be the file "msadonn.dll" where nn is the
version number). But even easier is to let MSQuery do the work for you: from
the Data menu choose "Import External Data..." and "New Database Query..."
Then you need to specify your data source (SQL Server) and design a query in
MSQuery to get the data you want (MSQuery acts a little like MS Access).
Once you have your data set you "Return Data to Microsoft Excel" (File menu
in MSQuery) and that will dump it onto a worksheet - from there you can use
formulas and lookups to manipulate the data. For info refer to Help file and
lookup "Importing Data."

"mk" wrote:

Hi
I need to connect from excel macro to MS SQL Server. I registered
ado.ocx but when I try to use it I have massage about linces restriction.
So how I can connect to MS SQL server to take some information and use
it in my macro.
I'm writing it for barcode terminal.
http://www.nordicid.com/fileadmin/su.../software1.htm

thanks
mk