+ Reply to Thread
Results 1 to 3 of 3

From excel connect to SQl

  1. #1
    Alvin Hansen
    Guest

    From excel connect to SQl

    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


  2. #2
    Rob Bovey
    Guest

    Re: From excel connect to SQl

    "Alvin Hansen" <[email protected]> wrote in message
    news:[email protected]...
    > 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



  3. #3
    Alvin Hansen
    Guest

    Re: From excel connect to SQl

    Thanks

    Alvin


    "Rob Bovey" skrev:

    > "Alvin Hansen" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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
    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1