+ Reply to Thread
Results 1 to 7 of 7

Updating SQLServer from excel using VBA

  1. #1
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Updating SQLServer from excel using VBA

    Hi,

    I have been trying to update the contents of the attached excel 2003 file using VBA to a SQL Server express database hosted on a server.

    The database details are as follows:

    ODBC;DSN=CFXWMS;UID=cfx;;APP=Microsoft Office 2003;WSID=LD04;DATABASE=CFXWMS

    Tables to be updated are ORDERHEADER.REFORDERNO, ORDERHEADER.TRACKINGNO which match the attached excel file.

    Basically I want the VBA to look for the ID in column A (REFORDERNO) and update the tracking information column B (TRACKINGNO) from the excel file to the ORDERHEADER table of the CFXWMS database.

    Any help is appreciated.

    David
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Updating SQLServer from excel using VBA

    I have been searching on the internet and am unable to find a close enough example to apply to my needs. Any pointers or suggestions are appreciated.

    Thanks,

    David

  3. #3
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Updating SQLServer from excel using VBA

    I'm still unable to update sql with the information on my xls file, has anybody out there ever tried to update an access db with linked tables to the sql server?

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Updating SQLServer from excel using VBA

    Something like:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Updating SQLServer from excel using VBA

    Kyle,

    Thanks for the response, when I ran the VBA it gave me the following error [Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied.

    I appreciate your help,

    David

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Updating SQLServer from excel using VBA

    That's your connection string, not mine - so I can't help you with that one I'm afraid. You might need to speak to whoever created the dsn on your machine or get a direct connection string without using ODBC

  7. #7
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Updating SQLServer from excel using VBA

    Sounds good, again thanks for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Want to use Excel column cells as parameters to SQLSERVER query
    By KWMKWM in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-21-2010, 05:21 AM
  2. Excel - MS sqlserver 2000 connection
    By wannesh in forum Excel General
    Replies: 0
    Last Post: 02-03-2006, 11:10 AM
  3. VBA Insert Stement for SQLServer
    By marcmc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:20 PM
  4. [SOLVED] VBA Insert Stement for SQLServer
    By marcmc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:17 PM
  5. ADODB from SQLServer - IF function?
    By Dianne Butterworth in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2005, 11:06 AM

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