Re: Importing Text file via Query and Schema File

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



Certainly one can use schema.ini with a query. Do you have
ColNameHeader=False
in the [TICBAL 02_2006.txt] (or whatever the filename is) section of
schema.ini?

Also, what do you mean by "I checked my schema.ini folder"? Schema.ini
must be in the same folder as the file you are importing.

On Fri, 31 Mar 2006 08:56:02 -0800, John
<John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Ok that fixed the problem, but now when I execute the query I get another
error message saying Account_Nbr is an unknown field. I checked my
schema.ini folder and it is there. Here is the line from the schema file:

Col1=Account_Nbr Text Width 10

Could it be that you can't utilize a schema file when using a query?


"John Nurick" wrote:

Hi John,

I can't remember the details and can't test it here, but have you tried
enclosing the whole filename in brackets

...].[;].[TICBAL 02_2006#txt];

"John" <John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:92296E7F-8CB0-4C37-AA7D-817D1E8EC7D5@xxxxxxxxxxxxxxxx
I am trying to import a text file into a table using an SQL query to pull
in
data from a text file without headers. I placed a schema.ini in the same
folder as the text file to define the columns. I tried the following
query I
found in another issue but I get an error message syntax error in FROM
clause. It seems to not like the # character. Any suggestions?

INSERT INTO MyTable
SELECT Account_Nbr
FROM [Text;HDR=No;Database=G:\FINANCIAL\Jacocella\Net
Margin\Analysis;].[TICBAL 02_2006]#txt;




--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

.



Relevant Pages

  • Re: Getting filename query to honor index exclusions
    ... > I'm using Index Server on Win Server 2k3 with the ixsso object to query ... > disable indexing on a particular folder, I still get filename matches from ... > matches not only in content but also by filename. ...
    (microsoft.public.inetserver.indexserver)
  • Re: Saving Office files on a network
    ... > and then attempt to do a Save As, then use a different filename, I get the ... > message “The folder ‘F:\document name.doc’ isn’t accessible. ... > then paste it into a new document, I still get the same error message when I ... > I can browse, change filenames, and do anything I want using Windows ...
    (microsoft.public.excel.misc)
  • Re: whats the function of build.dat [D:WINCE420PLATFORMSitsang
    ... I had a filename called old interrupt.c in .../kernel/hal wich caused the same ... error message due to the space in the filename. ... This is typically caused by folder names with a space in them. ...
    (microsoft.public.windowsce.platbuilder)
  • Getting filename query to honor index exclusions
    ... The problem is that the query does not honor the indexing restrictions setup ... disable indexing on a particular folder, I still get filename matches from ... I want the index server query to honor these folder exclusions when it finds ... matches not only in content but also by filename. ...
    (microsoft.public.inetserver.indexserver)
  • Access Security Issue
    ... I get the following error message when I attempt to called query which ... I went into the folder and and the file and change ... When I look at the file permissions of the directory, ...
    (microsoft.public.dotnet.framework.adonet)