|
-
Jan 26th, 2005, 02:02 PM
#1
Thread Starter
New Member
I'm new to this and not having any luck
--------------------------------------------------------------------------------
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|