Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > select for a text file

Reply
Thread Tools

select for a text file

 
 
atse
Guest
Posts: n/a
 
      10-06-2003
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


 
Reply With Quote
 
 
 
 
Randy Rahbar
Guest
Posts: n/a
 
      10-06-2003
> But the way, where can I find more samples of query string of all kinds of
> database connection?


http://www.connectionstrings.com


 
Reply With Quote
 
 
 
 
TomB
Guest
Posts: n/a
 
      10-06-2003
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" <(E-Mail Removed)> wrote in message
news:GHjgb.240378$(E-Mail Removed) 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
>
>



 
Reply With Quote
 
atse
Guest
Posts: n/a
 
      10-07-2003

"Randy Rahbar" <rvrahbarAThotmail.com> wrote in message
news:(E-Mail Removed)...
> > 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


 
Reply With Quote
 
Randy Rahbar
Guest
Posts: n/a
 
      10-07-2003
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can JavaScript select text in a text-field? Kurda Yon Javascript 0 01-20-2009 01:07 AM
Get text from SELECT into hidden text? Marco Krechting ASP General 5 01-10-2005 06:04 AM
How can you put text from a file into a textarea box, when the file is selected from a Select list! Shaiboy_UK ASP General 11 12-22-2004 07:46 AM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM
XSLT Select nodes without text-node children whose names starts with specifix text Michael Reiche XML 3 02-05-2004 10:40 PM



Advertisments