+ Reply to Thread
Results 1 to 6 of 6

insert excel data into sql table

  1. #1
    Registered User
    Join Date
    07-09-2012
    Location
    Podgorica
    MS-Off Ver
    Excel 2007
    Posts
    3

    insert excel data into sql table

    Hi,
    I have an excel sheet with data that I would like to send to sql server.General idea is to have button on sheet which will insert data from specific row (row where cursor is in position) into sql table with same data structure.
    I'm not familiar with excel programming, but have some experience in VBA for Access.
    Could anybody help me?
    Thanks

  2. #2
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: insert excel data into sql table

    Hi,

    Then you need to download ODBC 5.1 Driver if you havent allready, then you can use the following to connect to the database.

    Please Login or Register  to view this content.
    Please take time to read the forum rules

  3. #3
    Registered User
    Join Date
    07-09-2012
    Location
    Podgorica
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: insert excel data into sql table

    Thanks,
    but how I do make a query that say:
    "insert into mytable(column1,column2,....) from 'row in sheet positioned by cursor'" ?

  4. #4
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: insert excel data into sql table

    Then you would do it like this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-09-2012
    Location
    Podgorica
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: insert excel data into sql table

    Thanks
    Now I have diferent problem,
    whe I try to run code get User-defined type not defined for "Dim c As ADODB.Connection", but in refences i did add "Microsoft ADO ext 2.8 for DDL and security"

  6. #6
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: insert excel data into sql table

    You have to create a reference to

    Microsoft ActiveX Data Objects X.X Libary

    X.X is the version number

+ 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