RE: SQL Syntax Problem
- From: Klatuu <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 9 Jun 2005 12:19:02 -0700
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;];"
>
.
- Follow-Ups:
- Re: SQL Syntax Problem
- From: John Nurick
- Re: SQL Syntax Problem
- References:
- SQL Syntax Problem
- From: Klatuu
- SQL Syntax Problem
- Prev by Date: Re: SQL Syntax Problem
- Next by Date: A2003 Problem accessing certain SQL records
- Previous by thread: Re: SQL Syntax Problem
- Next by thread: Re: SQL Syntax Problem
- Index(es):
Relevant Pages
|