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

Not a valid path?

I get the error message:
"Microsoft JET Database Engine (0x80004005)
'c:\inetpub\wwwroot\company\KUND.DBF' 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.
/company/test.asp, line 5"

The asp file is in the same folder as the dbf-file. This is my code:

<%
  Dim Conn: Set Conn = CreateObject("ADODB.Connection")
  Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                   "Data Source=" & Server.MapPath("KUND.DBF") & ";" & _
                   "Extended Properties=""DBASE IV;"";"
  Set OpenDBFConn = Conn

Set rs = Server.CreateObject("adodb.recordset")

SQL = "SELECT * From kund"
rs.open SQL,Conn,2,3

%>

Could any one tell me why I get this error?
0
torbjornfahlen
Asked:
torbjornfahlen
  • 2
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
In all the samples I have seen the actual datafile name is not specified. Have you tried:

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(".") & ";Extended Properties=dBASE IV;User ID=Admin;Password="
0
 
torbjornfahlenAuthor Commented:
Thank you!!!

That was strange, but it worked. =)
0
 
Carl TawnSystems and Integration DeveloperCommented:
No problem. For future reference, if you ever need a connection string for pretty much any database, you can look here:

    www.connectionstrings.com
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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