SELECT * INTO LocalTable FROM LinkedExcelSheet; .Execute does notwork; .RunSQL does

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Trish

    SELECT * INTO LocalTable FROM LinkedExcelSheet; .Execute does notwork; .RunSQL does

    I have been trying to create a local table from a linked Excel
    Spreadsheet using a simple query string like this:

    SELECT * INTO LocalTable FROM LinkedExcelShee t;

    If I use CurrentDB.Execu te, I get Error 3078 - The Microsoft Jet
    database engine cannot find the input table or query '128'. Make sure
    it exists and that its name is spelled correctly.

    If I use Docmd.RunSQL it works just fine. Why would that be?

    Thanks in advance for educating me.
  • Salad

    #2
    Re: SELECT * INTO LocalTable FROM LinkedExcelShee t; .Execute doesnot work; .RunSQL does

    Trish wrote:
    I have been trying to create a local table from a linked Excel
    Spreadsheet using a simple query string like this:
    >
    SELECT * INTO LocalTable FROM LinkedExcelShee t;
    >
    If I use CurrentDB.Execu te, I get Error 3078 - The Microsoft Jet
    database engine cannot find the input table or query '128'. Make sure
    it exists and that its name is spelled correctly.
    >
    If I use Docmd.RunSQL it works just fine. Why would that be?
    >
    Thanks in advance for educating me.
    You might want to look at TransferSpreads heet method.

    Comment

    • Trish

      #3
      Re: SELECT * INTO LocalTable FROM LinkedExcelShee t; .Execute does notwork; .RunSQL does

      On Nov 11, 3:05 pm, Salad <o...@vinegar.c omwrote:
      Trish wrote:
      I have been trying to create a local table from a linked Excel
      Spreadsheet using a simple query string like this:
      >
      SELECT * INTO LocalTable FROM LinkedExcelShee t;
      >
      If I use CurrentDB.Execu te, I get Error 3078 - The Microsoft Jet
      database engine cannot find the input table or query '128'.  Make sure
      it exists and that its name is spelled correctly.
      >
      If I use Docmd.RunSQL it works just fine.  Why would that be?
      >
      Thanks in advance for educating me.
      >
      You might want to look at TransferSpreads heet method.
      Oh yes, that's even better. I had forgotten all about
      TransferSpreads heet. But I am still curious as to why .Execute
      doesn't work. Is it because the input table is actually a spreadsheet?

      Comment

      Working...