• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2268
  • Last Modified:

MS Text driver probelm (unknown) path

HELP!  I put the path to my text file in the connection string but now the ODBC driver reports that my path is 'unknown'

Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C:\Inetpub\webhosting\orders.claydesign.com\AcornRepository\FO.CLAY.20040910.1126.csv;Extensions=asc,csv,tab,txt


Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

/Acorndatatransformations.asp, line 57


-Coolhand2120
0
Coolhand2120
Asked:
Coolhand2120
  • 12
  • 7
  • 7
2 Solutions
 
kmorris1186Commented:
I would say may sure that IUSR account has access, but since it is in inetpub it already should...

But check that out anyway.
0
 
Coolhand2120Author Commented:
I looked at the security settings, and they all are inherint, the site root propagates on this directory and file.  I can use filesystemobject to access the file.

-Coolhand2120
0
 
kmorris1186Commented:
What is the full path of the web site?

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kmorris1186Commented:
like c:\inetpub\wwwroot\website\webpage.asp?
0
 
Coolhand2120Author Commented:
path to web site: C:\Inetpub\webhosting\orders.claydesign.com

path to file C:\Inetpub\webhosting\orders.claydesign.com\AcornRepository\FO.CLAY.20040910.1126.csv

it's in the driver string in the first post, does this help?

-Coolhand2120
0
 
kmorris1186Commented:
have you tried this:

Driver={Microsoft Text Driver (*.txt;*.csv)};Dbq=AcornRepository\FO.CLAY.20040910.1126.csv;Extensions=asc,csv,tab,txt
0
 
Coolhand2120Author Commented:
Same deal:

Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=AcornRepository\FO.CLAY.20040910.1126.csv;Extensions=asc,csv,tab,txt
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

/Acorndatatransformations.asp, line 57



BTW I can type this C:\Inetpub\webhosting\orders.claydesign.com\AcornRepository\FO.CLAY.20040910.1126.csv into the "run" or "address" field on the server and I get the file in question so the file is definatly there.

-Coolhand2120
0
 
kmorris1186Commented:
This is actually for an Access Database, but it is worth a try.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;306269

you are SURE that IUSR_<computername> has access to that directory?
0
 
kmorris1186Commented:
0
 
Coolhand2120Author Commented:
This is the whole script:

I used to use the filesystemobject to read the file, and never had any probelm doing this, in fact I have other applications that run from the same web root that access files (via filesystemobject) that still run properly.  All the directories in the web root get their permissions from the root directory.  I can get the file from the site via the URL: Http://orders.claydesign.com/acornrepository/FO.CLAY.20040910.1126.csv so I really don't think it's a permission problem.

'---------------------Begin broken code

set objUpload = Server.CreateObject ("Dundas.Upload.2")

objUpload.UseUniqueNames = false


Set objNextFile = objUpload.GetNextFile()

uploadname =  objNextFile.FileName

objNextFile.FileName = uploadname & ".csv"

objNextFile.save "C:\Inetpub\webhosting\orders.claydesign.com\AcornRepository\"

set objNextFile = nothing
Set objUpload = Nothing


strPath = Server.MapPath("/AcornRepository/")
set objConnection=Server.CreateObject("ADODB.Connection")
strConnectionString = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" & strPath & "\" & uploadname & ".csv" & ""

objConnection.Open strConnectionString
strSQL = "Select * From datalink.csv"
set objRS=Server.CreateObject("ADODB.RecordSet")
objRS.Open strSQL, objConnection,3,3
arrRows=objRS.GetRows()
'let's prove that this works
Response.Write("<P>Colmn Index (starts at 0): " & UBound(arrRows,1)) ' Reads left to right
Response.Write("<br>Row Index (starts at 0): " & UBound(arrRows,2) & "<P>") ' Reads up to down

Response.Write("<Table Border=1 cellpadding=2 cellspacing=2>")
for i=0 to UBound(arrRows,2)
    Response.Write("<TR>")
    for j=0 to UBound(arrRows,1)
         Response.Write("<TD>" & arrRows(j,i) & "</TD>")
    next
    Response.Write("</TR>")
next
Response.Write("</Table>")

objRS.close
set objRS = Nothing
objConnection.Close
set objConnection = Nothing
'-------------end broken code


Thanks kmorris for all the help!

-Coolhand
0
 
Coolhand2120Author Commented:
sorry if the code has some "" and wierd comments, I'm working on it right now, so it's not pretty.

-Coolhand2120
0
 
fritz_the_blankCommented:
I am back--I had to go give a lecture. Where are we now with this?

FtB
0
 
Coolhand2120Author Commented:
This is still my problem


HELP!  I put the path to my text file in the connection string but now the ODBC driver reports that my path is 'unknown'

Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C:\Inetpub\webhosting\orders.claydesign.com\AcornRepository\FO.CLAY.20040910.1126.csv;Extensions=asc,csv,tab,txt


Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

/Acorndatatransformations.asp, line 57


-Coolhand2120
0
 
fritz_the_blankCommented:
What is the result of:

Response.write(strPath & "\" & uploadname & ".csv" & "")

I am also wondering if the . in your path are causing problems.

FtB
0
 
kmorris1186Commented:
if it is the . causing the problem, you can try this.....

NewPathName = escape("C:\Inetpub\webhosting\orders.claydesign.com\AcornRepository\")

I am going on a limb here, not sure if the driver will like the encoded path....
0
 
Coolhand2120Author Commented:
Thanks for the help guys!

I tried the escape function but it returns the same error.  Maybe there is a problem with the ODBC driver on the win2003 server?  It's funny that it says the path is '(unknown)'.

This is the resulting string:
Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C%3A%5CInetpub%5Cwebhosting%5Corders.claydesign.com%5CAcornRepository%5C\FO.CLAY.20040910.1126.csv;Extensions=asc,csv,tab,txt

This is the error it returns with escape:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

/Acorndatatransformations.asp, line 58


FtB you asked what the result of Response.write(strPath & "\" & uploadname & ".csv" & "") was:

C:\Inetpub\webhosting\orders.claydesign.com\AcornRepository\FO.CLAY.20040910.1126.csv

Sorry about the & "" thing I was working on the code when I copy/pasted it here.   I can take the string above and stick in the server's run dialog and it will return the file I uploaded.  I think the key symptom of the problem is this '(unknown)' path thing.  Why isn't it getting the path or is this a cryptic error?

-Coolhand2120
0
 
fritz_the_blankCommented:
Would it be possible to try this with a file that doesn't have any periods in it, i.e., instead of:

FO.CLAY.20040910.1126.csv

this:

FO_CLAY_20040910.1126.csv

FtB
0
 
Coolhand2120Author Commented:
Thanks for the continued help.

This is a response.write of the driver string:

Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C:\Inetpub\webhosting\orders.claydesign.com\AcornRepository\FO_CLAY_20040910_1126.csv;Extensions=asc,csv,tab,txt

this is the new file name: FO_CLAY_20040910_1126.csv

I still get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

/Acorndatatransformations.asp, line 58


Maybe it has nothing to do with the file/path even though thats what the error says (woudn't be a first).  I've tried searching for this everywhere and it's a very urgent matter.

Help us obi-fritz-kanobi, you're our only hope.

-Coolhand2120
0
 
Coolhand2120Author Commented:
Does this code work on your machine FtB?  Maybe it's some odd configuration on this server.

-Coolhand2120
0
 
fritz_the_blankCommented:
I can run this example on my machine verbatim--the datalink.csv file is in the same directory:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY>
<%
strPath = Server.MapPath(".")
set objConnection=Server.CreateObject("ADODB.Connection")
strConnectionString = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" &  strPath & "\;Extensions=asc,csv,tab,txt"
objConnection.Open strConnectionString
strSQL = "Select * From datalink.csv"
set objRS=Server.CreateObject("ADODB.RecordSet")
objRS.Open strSQL, objConnection,3,3
arrRows=objRS.GetRows()
'let's prove that this works
Response.Write("<P>Colmn Index (starts at 0): " & UBound(arrRows,1)) ' Reads left to right
Response.Write("<br>Row Index (starts at 0): " & UBound(arrRows,2) & "<P>") ' Reads up to down

Response.Write("<Table Border=1 cellpadding=2 cellspacing=2>")
for i=0 to UBound(arrRows,2)
     Response.Write("<TR>")
     for j=0 to UBound(arrRows,1)
          Response.Write("<TD>" & arrRows(j,i) & "</TD>")
     next
     Response.Write("</TR>")
next
Response.Write("</Table>")

objRS.close
set objRS = Nothing
objConnection.Close
set objConnection = Nothing


%>
</BODY>
</HTML>
0
 
fritz_the_blankCommented:
You might want to try testing this with the file in the same directory for troubleshooting purposes.

FtB
0
 
Coolhand2120Author Commented:
I can run your code with my file (renaming the file), it works great.   I'm trying the "in the same directory" thing right now.

Thank you, great one.

-Coolhand2120
0
 
fritz_the_blankCommented:
Glad to help. Now you can try one step at a time to make this what you need. Can you have it in the same directory with the extra periods in the file name?

FtB
0
 
Coolhand2120Author Commented:
FIXED!  

Geeze what a hassle

I response.write the strConnectionString in your original example and found there was no file name.  This was the probelm, in the driver I was putting the file name.  It really didn't like that.

Thanks for the help Fritz, I hope there is room in that brain of yours for some more information.

Microsoft Text Driver only accepts paths, not paths+filename.  The Select statment requests file names in the directory specified.

-Coolhand2120
0
 
Coolhand2120Author Commented:
I know nobody answered the question, but both of you helped quite a bit.  And I subscribe so I have a surplus of points.

-Coolhand2120
0
 
fritz_the_blankCommented:
Glad to have helped,

FtB
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 12
  • 7
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now