RE: SQL Syntax Problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for the response, John,
I tried changing the name of the work sheet to 'Eighty' to see if that was
the problem. It was not. If I name the range, it works fine. The issue is,
I can't depend on the person responsible for creating the sheet to put the
range name in it. That is why I was trying to use the Row/Column address.

I could try ADO, but in this case I am not sure how to tell Access to use
ADO, because the entire Sub consists of the strSQL = ... and the following:

CurrentDb.Execute strSql

How would I specifiy ADO or does that apply in this case?

"Klatuu" wrote:

> Below is an SQL statment I am trying to get to work to pull data into Access
> from Excel. The problem is with the range (FROM [80%!A3:P200] ). The
> current syntax is the closest I can get.
> The error returned is 3125 - Is not a valid name. Be sure it doesn't
> contain invalid characters or punctuation....
> Every other way I have tried returns 3131 Invalid syntax in FROM clause.
> I was suspicious about the %, but it workd with a transferspreadsheet. I
> really don't what to have to link it, I would rather just get it in this way.
>
> strSql = "INSERT INTO tblPipeline80 (Curr_Year, Curr_Month,
> Program_Manager, ITM, " _
> & "Opportunity, Resource, Jan, Feb, Mar, Apr, May, Jun, " _
> & "Jul, Aug, Sep, Oct, Nov, Dec, Source_Sheet ) " _
> & "SELECT '2005', '04', [Prog Mgr], ITM, Opportunity, Resource, Jan,
> Feb, " _
> & "Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, 'Pipeline 2005
> April'" _
> & " FROM [80%!A3:P200] IN '' [Excel 8.0;Hdr=Yes;DATABASE=" _
> & "C:\Documents and Settings\hargida\My Documents\Access\" _
> & "Pipeline 2005 April.xls;];"
>
.



Relevant Pages

  • Re: SQL Syntax Problem
    ... >Thanks for the response, John, ... >I tried changing the name of the work sheet to 'Eighty' to see if that was ... >I could try ADO, but in this case I am not sure how to tell Access to use ... John Nurick ...
    (microsoft.public.access.externaldata)
  • Re: Newbie: Data storage and manipulation speed
    ... Thanx for your kind response! ... plan to call DoEvents about 3-5 times per second. ... Access Table through ADO manipulations. ... But, if memory is insuficient, you'll ...
    (microsoft.public.vb.general.discussion)
  • Re: Access SQL Server Express over the Internet
    ... Very interesting - any reasons why not ADO? ... central server - everything works like a charm since two years. ... SET NO_BROWSETABLE ON [TDS RPC format] ... Some response (ack) ...
    (borland.public.delphi.database.ado)
  • Indexing Question
    ... I have a VB6 application in which I access a FP6 DB with ADO. ... As one of the tables gets bigger My response is degrading. ...
    (microsoft.public.fox.vfp.queries-sql)
  • Indexing Question
    ... I have a VB6 application in which I access a FP6 DB with ADO. ... As one of the tables gets bigger My response is degrading. ...
    (microsoft.public.data.ado)