?
Solved

MS Text driver probelm (unknown) path

Posted on 2004-09-21
26
Medium Priority
?
2,247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 7
  • 7
26 Comments
 
LVL 7

Expert Comment

by:kmorris1186
ID: 12116984
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
ID: 12117589
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
ID: 12117631
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!

 
LVL 7

Expert Comment

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

Author Comment

by:Coolhand2120
ID: 12117694
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
ID: 12117721
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
ID: 12117782
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
ID: 12117811
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
ID: 12117813
0
 
LVL 2

Author Comment

by:Coolhand2120
ID: 12117867
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
ID: 12117882
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
ID: 12118208
I am back--I had to go give a lecture. Where are we now with this?

FtB
0
 
LVL 2

Author Comment

by:Coolhand2120
ID: 12118770
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
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12122043
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 400 total points
ID: 12122661
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
ID: 12124981
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
ID: 12125196
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
ID: 12126501
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
ID: 12126516
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
ID: 12126570
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
ID: 12126578
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
ID: 12126630
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 1600 total points
ID: 12126664
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
ID: 12126761
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
ID: 12126789
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
ID: 12126803
Glad to have helped,

FtB
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

765 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