+ Reply to Thread
Results 1 to 4 of 4

Excel -> Access Importing Connection Error - Invalid SQL statement; expected 'DEL....

  1. #1
    Registered User
    Join Date
    12-22-2011
    Location
    Miami
    MS-Off Ver
    Excel 2010
    Posts
    3

    Excel -> Access Importing Connection Error - Invalid SQL statement; expected 'DEL....

    Hello-

    I've recently upgraded to Excel 2010 and my firm has decided not to purchase Access with the 2010 Office suite. Because of this I need a new connection method to an Access database (from xls) that doesn't require the user to have Access 2010 on their machine. I'm now trying to tweak my access importing function to use an ADODB connection and I'm getting the error above. If anyone has any sample code that achieves an import of an xls spreadsheet into an Access table from xls 2010 it would be my Christmas miracle. Here's the function I'm working with. I've taken numerous stabs in the dark so I apologize if it's not even close to what I ultimately need to make this happen.

    I have one line of code commented out below, when I switch back and forth I do get a different error. Not sure which one is closer to achieving the import.

    Please Login or Register  to view this content.
    Any assistance is appreciated.

    Thanks,
    Last edited by scottr1; 12-27-2011 at 05:05 PM.

  2. #2
    Registered User
    Join Date
    12-22-2011
    Location
    Miami
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel -> Access Importing Connection Error - Invalid SQL statement; expected 'DEL

    Bueller, Bueller? No snippets of vba for xls into access using ADODB.Connection?

  3. #3
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Excel -> Access Importing Connection Error - Invalid SQL statement; expected 'DEL

    At first view, the issue appears to be the single quotes around the INSERT INTO statement - they do no belong there. You also do not need to specify the provider twice, although I do not believe that will actually cause a problem.
    Good luck.

  4. #4
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Excel -> Access Importing Connection Error - Invalid SQL statement; expected 'DEL

    Here is a very simplistic snippet of code to load a workbook into a database

    Please Login or Register  to view this content.

+ 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.6.0 RC 1