Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query CSV File on Linux Machine

Status
Not open for further replies.

avantgd

Programmer
Jan 22, 2002
16
US
I need to query / display information a CSV File on a Linux Server using ASP. I have done this a lot on Windows servers. However, I am new to Linux.

Any help is greatly appreciated.
 
From the point of view of your ASP page is the Linux server just a big harddrive in the sky?

Or do you have SunONE or ChiliSoft or some other Unixed based ASP server instead of Microsoft IIS ?
 
i have never dealt with this situation but i would search for "Reading CSV files using chilisoft ASP" on google...

good luck

-DNG
 
Please excuse my ignorance concerning the question posed about the server. The server is provided via a web host. I was told it was a Linux server with Active Server pages enabled. I am almost positive it is an ASP server other than Microsoft IIS, but I do not know which one. If that is important, I can find it out.

I wanted to use ASP because it is more familiar than PHP, which is also an option. However, if PHP would be simpler, please point me in the right direction.
 
Find out if the server also has a way to emulate ADO... if not find out if it can emulate the FileSystemObject.

The former would be preferable since your queries would be eaier but you could get by with FSO in a pinch.
 
I have been unable to determine if the server can emulate ADO. I thought it might be best to write a test page and see if it works. I have never used ADO to read a CSV file. Can you help me get me started?

thanks!
 
I appreciate the last link provided. It was very helpful. However, because the server is Linux, I don't think the Microsoft.Jet.OLEDB.4.0 provider will work. Please correct me if I am wrong. Can someone tell me what would be the provider on a linux machine?
 
I have determined that the server can emulate ADO. I have started my program as follows:

Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")

strPathtoTextFile = Request.ServerVariables("PATH_TRANSLATED")

objConnection.Open "Provider=???;" & _
"Data Source=" & strPathtoTextFile & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited"""

However, I am stuck as to what provider to use for the Linux server. Can anyone help?
 
try this:

objConnection.Opne "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=c:\txtFilesFolder\;Extensions=asc,csv,tab,txt;"

-DNG
 
Thank you everyone for your help. I was able to find out that the server is using ChiliSoft ASP which is different than traditional ASP. My program so far is:

strPath = getServerPath() & "/"

Set objConnection = CreateObject("ADODB.Connection")
Set rstEntries = CreateObject("ADODB.Recordset")

objConnection.Open "Driver={Text};" & _
"Database=" & strPath & ";"

sqlEntries = "SELECT * FROM " & strFileName
rstEntries.Open sqlEntries, objConnection

And then I get the following error:

ADODB.Recordset.1 error '80004005'

SQLState: S1C00
Native Error Code: 0
[MERANT][ODBC Text driver]Optional feature not implemented.

I assume this is because the TEXT provider has not been loaded. However, if someone has another idea, please correct me.

I will keep you posted on my progress in case someone else has the same need.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top