From excel connect to SQl

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

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

Best regards Alvin
 
Alvin Hansen said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top