+ Reply to Thread
Results 1 to 2 of 2

Thread: Import SQL data, edit, then update back to SQL

  1. #1
    Registered User
    Join Date
    04-15-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Import SQL data, edit, then update back to SQL

    Hi all, great forum. I have been coming here on and off to lurk the questions and answers. I haven't been able to find a good answer so here goes.

    I have multiple databases on a local sql server and each database corresponds to a subproject.
    I'm trying to import data from certain tables -- I've been able to do that with the database connection feature of excel -- but I want to edit the data directly then update the table.

    I can edit the data manually with queries, but I want to write a macro that will allow people to edit certain records without the need to learn SQL.

    For example:
    I have DB1 with table T1 and columns A and B with 2 records.
    I've imported the table into excel, and see the table.
    I want to change the value in column B then export it to the database.
    Is this possible? If so, how?

    I know that I can save the table in a csv file, then load the file into the database via sql queries, but that's still not simple enough.

    Ideally, I'd like to find some info on how to put this all into vba:
    connect to sql database
    execute a select query
    execute an update query.

    Any direction would be nice. Thanks in advance.

  2. #2
    Valued Forum Contributor nimrod's Avatar
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10
    Posts
    609

    Re: Import SQL data, edit, then update back to SQL

    Contactus ut Sentio

    YOUR FEEDBACK: To Say Thanks, or to leave Constructive Comments, please click on the Scales of Justice Icon at top of current post.

    >Develope Good Habits with MSDN Coding Standards <>How To Add Macros & VBA Code To Your Workbooks<>Best Practices For Referencing Cells, Ranges and Sheets<

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0