Solved

MS Text driver probelm (unknown) path

Posted on 2004-09-21
26
2,212 Views
Last Modified: 2008-02-01
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
Comment
Question by:Coolhand2120
  • 12
  • 7
  • 7
26 Comments
 
LVL 7

Expert Comment

by:kmorris1186
Comment Utility
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
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
 
LVL 7

Expert Comment

by:kmorris1186
Comment Utility
What is the full path of the web site?

0
 
LVL 7

Expert Comment

by:kmorris1186
Comment Utility
like c:\inetpub\wwwroot\website\webpage.asp?
0
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
 
LVL 7

Expert Comment

by:kmorris1186
Comment Utility
have you tried this:

Driver={Microsoft Text Driver (*.txt;*.csv)};Dbq=AcornRepository\FO.CLAY.20040910.1126.csv;Extensions=asc,csv,tab,txt
0
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
 
LVL 7

Expert Comment

by:kmorris1186
Comment Utility
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
 
LVL 7

Expert Comment

by:kmorris1186
Comment Utility
0
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
sorry if the code has some "" and wierd comments, I'm working on it right now, so it's not pretty.

-Coolhand2120
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
I am back--I had to go give a lecture. Where are we now with this?

FtB
0
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
What is the result of:

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

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

FtB
0
 
LVL 7

Assisted Solution

by:kmorris1186
kmorris1186 earned 100 total points
Comment Utility
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
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
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
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
Does this code work on your machine FtB?  Maybe it's some odd configuration on this server.

-Coolhand2120
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
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
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
You might want to try testing this with the file in the same directory for troubleshooting purposes.

FtB
0
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 400 total points
Comment Utility
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
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
 
LVL 2

Author Comment

by:Coolhand2120
Comment Utility
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
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
Glad to have helped,

FtB
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now