Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to open DBF
Message
From
30/05/2003 16:25:03
Michael Hunt
United Insurance Co Ltd
Bridgetown, Barbados
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Unable to open DBF
Miscellaneous
Thread ID:
00794743
Message ID:
00794743
Views:
39
Hi there.
I am trying to access a table, which is stored in \\headoffice-dell\PlayUfos\data\. When I run the script to open the table I get an error that it was unable to open the “table”.dbf.
I have place an mdb in the same folder and was able to access the table. I then placed the DBC and DBF into the web root and was able to access the data.

For some reason the asp page was unable to open the dbf once it was not in the web root. How can I get pass this?

The code below:

<%

function Fox
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = 15
DataConn.CommandTimeout = 30
DataConn.mode = 16
DataConn.provider="MSDASQL.1"
DataConn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBC;" & _
"SourceDB=\\headoffice-dell\PlayUfos\data\test.dbc;" & _
"Exclusive=No; Null=No"

set rs = server.CreateObject("ADODB.RecordSet")
rs.Source="SELECT * FROM john"
rs.Open, DataConn
do until rs.eof
Response.write rs("Name") &"
"
rs.MoveNext
Loop
rs.Close
end function

function Access
Session.Timeout = 20
Set cn = Server.CreateObject("ADODB.Connection")
ProvStr = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=\\headoffice-dell\PlayUfos\data\temp.mdb"
cn.Open ProvStr

set rs = server.CreateObject("ADODB.RecordSet")
rs.Source="SELECT * FROM Name"
rs.Open, cn
do until rs.eof
Response.write rs("Names") &"
"
rs.MoveNext
Loop
rs.Close
end function

Access ‘ This will run the Access function
Fox ‘ This will run the Fox function
Next
Reply
Map
View

Click here to load this message in the networking platform