Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
connect to MS SQL
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Connect.UpdateToolbars? | Excel Discussion (Misc queries) | |||
Connect to OPC / DDE server | Excel Worksheet Functions | |||
Excel cannot connect to web | Excel Discussion (Misc queries) | |||
SQL Connect | Excel Programming | |||
VB how to connect two sub's | Excel Programming |