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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement