473,388 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

select for a text file

Hi,
I tried to make select query to a text file using the code below,

<%
sconnection="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="D:\myforlder\;Extended Properties=""text;HDR=No;FMT=Delimited"""

set conn2=server.CreateObject("ADODB.Connection")
conn2.open(sconnection)

set dRs=conn2.execute("select * from test.txt")

%>

But it complaints that:

Microsoft JET Database Engine error '80040e14'

Syntax error in FROM clause.

/thisfile.asp, line 7 (set dRs=conn2.execute("select * from test.txt"))

Any errors have I made? But if the file is test.csv, it works fine.
But the way, where can I find more samples of query string of all kinds of
database connection?
Thanks

Atse
Jul 19 '05 #1
4 3712
> But the way, where can I find more samples of query string of all kinds of
database connection?


http://www.connectionstrings.com
Jul 19 '05 #2
I assume your connection string is on one line?

sconnection="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="D:\myforlder\;Extended Properties=""text;HDR=No;FMT=Delimited"""
---------^

what's that for?

"atse" <du******@yahoo.com> wrote in message
news:GH********************@news01.bloor.is.net.ca ble.rogers.com...
Hi,
I tried to make select query to a text file using the code below,

<%
sconnection="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="D:\myforlder\;Extended Properties=""text;HDR=No;FMT=Delimited"""

set conn2=server.CreateObject("ADODB.Connection")
conn2.open(sconnection)

set dRs=conn2.execute("select * from test.txt")

%>

But it complaints that:

Microsoft JET Database Engine error '80040e14'

Syntax error in FROM clause.

/thisfile.asp, line 7 (set dRs=conn2.execute("select * from test.txt"))

Any errors have I made? But if the file is test.csv, it works fine.
But the way, where can I find more samples of query string of all kinds of
database connection?
Thanks

Atse

Jul 19 '05 #3

"Randy Rahbar" <rvrahbarAThotmail.com> wrote in message
news:OU**************@tk2msftngp13.phx.gbl...
But the way, where can I find more samples of query string of all kinds of database connection?


http://www.connectionstrings.com

Sorry, I can't find what I want. I want the select string for a text file:

"select [what] from [what] where [what] = [what]"

Because there is no table, or field name in the text file, how can I write
this string. Thanks for any idea.

Atse
Jul 19 '05 #4
> Sorry, I can't find what I want. I want the select string for a text file:

"select [what] from [what] where [what] = [what]"

Because there is no table, or field name in the text file, how can I write
this string. Thanks for any idea.

Atse


I'm assuming the first row of your comma-delimited text file are the column
names...

So, if the first column name is Column_ID and the second column name is
Column_Name, I think something like this should work...

SELECT Column_Name FROM yourtextfile.txt WHERE Column_ID = 1
-Randy
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: JohnSouth104 | last post by:
Hi I want to warn the user that changing the selected item in a pull-down will clear some data he has already entered in a file download box. I've tried using confirm() to return true or false...
7
by: Peter Proost | last post by:
Hi, I'm creating an import module to read data from old textfiles, run some calculations on them and save them to sql server. I've figured out how to do a select on textfile using a schema.ini file...
8
by: Jacob Arthur | last post by:
How would I go about using a custom select string that is passed from a form to the SelectCommand parameter of SqlDataSource? I tried: SelectCommand = "<% Request.Form("hdnSelect") %>" but I...
9
chunk1978
by: chunk1978 | last post by:
hey everyone, i've been trying to solve this problem for 2 days straight, with no end in sight. i would greatly appreciate anyone's help. EXPLANATION: There are 3 Select Menus. The 1st and...
2
by: naima.mans | last post by:
Hello, i want to select 2 following brothers nodes wich are one under another (one closed to another)... i have done one xslt file... but it's not really good.. for example: the xml file:...
3
by: Billy | last post by:
I do a SELECT * from table command in an ASP page to build a text file out on our server, but the export is not to allow a field name rows of records. The first thing I get is a row with all the...
2
by: Tarik Monem | last post by:
OK! I've gone through a few tutorials and I cannot understand what I'm doing wrong casting_registration.php <table> <tr> <td> <form enctype="multipart/form-data" action="thankyou.php"...
21
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays...
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
3
by: ibeehbk | last post by:
Hi. I have a form made in xhtml. I test via vbscript to make sure none of the fields are empty and properly formatted (ie email). All the regular fields work. However, I have two drop down menus...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.