Hi there. I am having problems connecting to an older ( version unknown) FoxPro database through an ASP page. I tried using a DSNless connection, then tried again with various DSNs through a MS Access database. For example, the code below shows my attempt to connect to a MS Access database names ProjFinance through a DSN named "ProjFinance." The Access DB has links to the FoxPro tables. On my laptop, the tables open fine. Then when the web page tries to open the recordset through the second DSN used by Access to connect to the FoxPro tables, the connection fails. Any ideas?
----Begin code----------
Dim conn, stconn
Set conn = Server.CreateObject("ADODB.Connection"
conn.Open "DSN=ProjFinance"
'---Comments blow are ealier attempts
'conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;
'Data Source=\\accounting\sema4\data\ProjFinance.mdb"
'conn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
' "SourceType=DBC;" & _
' "SourceDB=\\accounting\sema4\data\S4DBC.DBC;" & _
' "Exclusive=No"
%>
<%
Dim rs, strQuery, cmdTemp
Set cmdTemp = Server.CreateObject("ADODB.Command"
Set rs = Server.CreateObject("ADODB.Recordset"
strQuery = "SELECT time.timproj, employee.empsname, " + _
"time.timpe, time.timbrate, time.timwhrs, time.timbhrs, [timbrate]*[timwhrs] AS wamt, " + _
"[timbrate]*[timbhrs] AS bamt " + _
"FROM employee INNER JOIN [time] ON employee.empidno = time.timemp " + _
"WHERE (((time.timproj)='12-0009'));"
cmdTemp.CommandText = strQuery
cmdTemp.CommandType = 1 'SQL statement
Set cmdTemp.ActiveConnection = conn
rs.CacheSize = 10
rs.Open cmdTemp,,adOpenStatic
----Begin code----------
Dim conn, stconn
Set conn = Server.CreateObject("ADODB.Connection"
conn.Open "DSN=ProjFinance"
'---Comments blow are ealier attempts
'conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;
'Data Source=\\accounting\sema4\data\ProjFinance.mdb"
'conn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
' "SourceType=DBC;" & _
' "SourceDB=\\accounting\sema4\data\S4DBC.DBC;" & _
' "Exclusive=No"
%>
<%
Dim rs, strQuery, cmdTemp
Set cmdTemp = Server.CreateObject("ADODB.Command"
Set rs = Server.CreateObject("ADODB.Recordset"
strQuery = "SELECT time.timproj, employee.empsname, " + _
"time.timpe, time.timbrate, time.timwhrs, time.timbhrs, [timbrate]*[timwhrs] AS wamt, " + _
"[timbrate]*[timbhrs] AS bamt " + _
"FROM employee INNER JOIN [time] ON employee.empidno = time.timemp " + _
"WHERE (((time.timproj)='12-0009'));"
cmdTemp.CommandText = strQuery
cmdTemp.CommandType = 1 'SQL statement
Set cmdTemp.ActiveConnection = conn
rs.CacheSize = 10
rs.Open cmdTemp,,adOpenStatic