View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alvin Hansen[_2_] Alvin Hansen[_2_] is offline
external usenet poster
 
Posts: 209
Default From excel connect to SQl

Thanks

Alvin


"Rob Bovey" skrev:

"Alvin Hansen" wrote in message
...
I try from excel to connect a SQL server
I try to use Server.Createobject("ADODB.Connection")

Can't i use this in excel or is it because i shall install some Tools/Ref


Hi Alvin,

It looks like you copied that from some ASP code. There is no Server
object in Excel VBA, so change it to just:

CreateObject("ADODB.Connection")

and it should work fine in Excel.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm