--------------------------------------------------------------------------------

Hey gurus,

I have a problem with ADO.

I am trying to develop an asp page and connect to a Visual FoxPro .dbf I don't know whats going on, but it won't work.

Here is what I've got.


Code:
<%
function getCurrentDir()
  getcurrentdir = mid(server.MapPath("testbook.dbf"), 1, instrrev(server.MapPath("testbook.dbf"), "\"))
  getCurrentDir = left(getCurrentDir, len(getCurrentDir) - 1)
end function

Dim adoCon
Dim rsGuestbook
Dim strSQL
dim path

path = createobject("wscript.shell").currentdirectory

set adocon = server.CreateObject("ADODB.Connection")

adoCon.Open "DSN=test"

'Driver={Microsoft Visual FoxPro Driver};" & _
'     "SourceType=DBF;" & _
'     "SourceDB=" & getCurrentDir & ";" & _
'     "Exclusive=No;"
							
set rsGuestbook = server.CreateObject("ADODB.recordset")

strsql = "SELECT * FROM testBook"
Response.Write(strsql)
rsGuestbook.Open strsql, adoCon

do while not rsGuestbook.EOF
	Response.Write("<BR>")
	Response.Write(rsGuestbook.Fields("name").Value)
	Response.Write("<BR>")
	Response.Write(rsGuestbook.Fields("Comments").Value)
	Response.Write("<BR>")
	rsGuestbook.MoveNext
loop

rsGuestbook.Close
set rsguestbook = nothing
set adocon = nothing
%>
The error I get is
Quote:
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

[Microsoft][ODBC Visual FoxPro Driver]File 'testbook.dbf' does not exist.

/testweb/guestBook.asp, line 33



Its there, I promise. Its in the current directory. My DSN is setup on the server with a System DSN. I'm not developing on the webserver, if that matters.

Hope someone can help me out, I'm about to go NUTS.

Thanks