XLodbc.xla to ADO
I have recently inherited an excel macro that was working fine until we
installed office 2003. I see that in office 2003 it says not to use
XLODBC.xla, rather use the functions and methods in ADO. My question is
what library do I use for ADO I see that I have several to choose from and
then how do I convert this small bit of code to use ADO.
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++
Worksheets("Sheet1").Select QueryString = "SELECT wiplot.wlot_lot_number,
wiplot.wlot_prod, wiplot.wlot_route FROM comets:wsopen.wiplot wiplot WHERE
wiplot.wlot_lot_number= " & "'" & lotnumber & "'"
chan =
SQLOpen("DSN=xxxxxxxx;UID=xxxxxxxx;DB=xxxxxxx;HOST =xxxxxxxxx;SERV=xxxxxxx;PRO=onsoctcp;PWD=xxxxxxx")
SQLExecQuery chan, QueryString
Set output = Worksheets("Sheet1").Range("G1")
SQLRetrieve chan, output, , , True
SQLClose chan
+++++++++++++++++++
TIA
Josh
|