We have Web Server on a Windows NT 4.0 machine which is accessing a
Foxpro database (Version 2.5) in another Windows NT 4.0 machine on the network.
When we try to connect the Foxpro Database from the Web Server, Using ASP through System DSN
it is giving us the following Error.
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC Visual FoxPro Driver]File 'emp.dbf' does not exist.
Is there any problem with the Foxpro ODBC DLL vfpodbc.dll (Version 6.0.8862.0), If so can you suggest any solution.
This is the code in the global.asa of the project.
Here we create an Apllication level Variable for storing the
connection string.
Application("FOX25_ConnectionString"
= "DSN=FOXDB;"
Application("FOX25_ConnectionTimeout"
= 15
Application("FOX25_CommandTimeout"
= 30
Application("FOX25_CursorLocation"
= 3
Application("FOX25_RuntimeUserName"
= ""
Application("FOX25_RuntimePassword"
= ""
-------------------------------------------------------------------------------------
This is code which Quries the Foxpro database depending upon the Operation .
<%@ Language=VBScript EnableSessionState=False%>
<%Response.Buffer="True"%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
'Set a reference & creates an instance of ADO Connection,Recordset & Command Object
<OBJECT RUNAT=server PROGID=ADODB.Connection id=ADOConn> </OBJECT>
<OBJECT RUNAT=server PROGID=ADODB.Recordset id=ADORec> </OBJECT>
<OBJECT RUNAT=server PROGID=ADODB.Command id=ADOCmd> </OBJECT>
<%
dim txtFirstName
dim txtLastName
dim dtmDOB
dim txtLogin
dim txtPassword
dim strListCol
'List variables used get the the value from Insert New record page using the
'Request Object.
txtFirstName = Request.Form("txtFirstName"
txtLastName = Request.Form("txtLastName"
dtmDOB = Request.Form("dtmDOB"
txtLogin = Request.Form("txtLogin"
txtPassword = Request.Form("txtPassword"
txtURL = Request.QueryString("URL"
'Setting then Connection object properties.
ADOConn.ConnectionString = Application.Contents("FOX25_ConnectionString"
ADOConn.CursorLocation = 3 'adUseClient Constant
ADOConn.Open
'Checking the operation to be performed i.e. Read,Create,Update & Delete from the Database.
Operation = ucase(Trim(Request.QueryString("OP"
))
'According to the operation to be performed the required SQL Query is created.
dim strSQL
Select Case Operation
case "CREATE"
strSQL = "Insert into Emp"
strSQL = strSQL & " (FIRSTNAME, LASTNAME, DOB, LOGIN, PASSWD)"
strSQL = strSQL & " Values ('" & txtFirstName & "','"
strSQL = strSQL & txtLastName & "',ctod('" & dtmDOB & "'),'"
strSql = strSql & txtLogin & "','" & txtPassword & "') "
case "READ"
strSQL = "Select * From EMP"
strListCol = ""
case "UPDATE"
case "DELETE"
case else
end Select
if Operation = "CREATE" or Operation = "UPDATE" or Operation = "DELETE" then
ADOConn.Execute strSQL
ADOConn.Close
Response.Redirect (txtURL)
else
ADORec.Open strSQL,ADOConn,3,4
dim strTable
'Display the records from the Database on the browser in a table using Recordset Objects GetStrinng Method.
strTable = "<TABLE id=TABLE1 cellSpacing=1 cellPadding=1 width='85%' border=1><TR><TD>"
strTable = strTable & ADORec.GetString(2,ADORec.RecordCount,"</TD><TD>","</TD></TR><TR><TD>"
strTable = strTable & "</TABLE>"
strTable = strTable & "<P align=center> <A href=" & txtURL & ">BACK</A></P>"
Response.Write strTable
end if
%>
<P> </P>
</BODY>
</HTML>
----------------------------------------------------------------------------------------------------
When we Debug or RUN the Code from Visual Interv Dev IDE then it doesn't give any error irrespective
of whether the Foxpro database on the Network or on the same machine.
In the DSN we have given the path pointing to the directory containing table .DBF file.
Iam waiting for your reply.
Regards.
Ganesh.
Foxpro database (Version 2.5) in another Windows NT 4.0 machine on the network.
When we try to connect the Foxpro Database from the Web Server, Using ASP through System DSN
it is giving us the following Error.
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC Visual FoxPro Driver]File 'emp.dbf' does not exist.
Is there any problem with the Foxpro ODBC DLL vfpodbc.dll (Version 6.0.8862.0), If so can you suggest any solution.
This is the code in the global.asa of the project.
Here we create an Apllication level Variable for storing the
connection string.
Application("FOX25_ConnectionString"
Application("FOX25_ConnectionTimeout"
Application("FOX25_CommandTimeout"
Application("FOX25_CursorLocation"
Application("FOX25_RuntimeUserName"
Application("FOX25_RuntimePassword"
-------------------------------------------------------------------------------------
This is code which Quries the Foxpro database depending upon the Operation .
<%@ Language=VBScript EnableSessionState=False%>
<%Response.Buffer="True"%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
'Set a reference & creates an instance of ADO Connection,Recordset & Command Object
<OBJECT RUNAT=server PROGID=ADODB.Connection id=ADOConn> </OBJECT>
<OBJECT RUNAT=server PROGID=ADODB.Recordset id=ADORec> </OBJECT>
<OBJECT RUNAT=server PROGID=ADODB.Command id=ADOCmd> </OBJECT>
<%
dim txtFirstName
dim txtLastName
dim dtmDOB
dim txtLogin
dim txtPassword
dim strListCol
'List variables used get the the value from Insert New record page using the
'Request Object.
txtFirstName = Request.Form("txtFirstName"
txtLastName = Request.Form("txtLastName"
dtmDOB = Request.Form("dtmDOB"
txtLogin = Request.Form("txtLogin"
txtPassword = Request.Form("txtPassword"
txtURL = Request.QueryString("URL"
'Setting then Connection object properties.
ADOConn.ConnectionString = Application.Contents("FOX25_ConnectionString"
ADOConn.CursorLocation = 3 'adUseClient Constant
ADOConn.Open
'Checking the operation to be performed i.e. Read,Create,Update & Delete from the Database.
Operation = ucase(Trim(Request.QueryString("OP"
'According to the operation to be performed the required SQL Query is created.
dim strSQL
Select Case Operation
case "CREATE"
strSQL = "Insert into Emp"
strSQL = strSQL & " (FIRSTNAME, LASTNAME, DOB, LOGIN, PASSWD)"
strSQL = strSQL & " Values ('" & txtFirstName & "','"
strSQL = strSQL & txtLastName & "',ctod('" & dtmDOB & "'),'"
strSql = strSql & txtLogin & "','" & txtPassword & "') "
case "READ"
strSQL = "Select * From EMP"
strListCol = ""
case "UPDATE"
case "DELETE"
case else
end Select
if Operation = "CREATE" or Operation = "UPDATE" or Operation = "DELETE" then
ADOConn.Execute strSQL
ADOConn.Close
Response.Redirect (txtURL)
else
ADORec.Open strSQL,ADOConn,3,4
dim strTable
'Display the records from the Database on the browser in a table using Recordset Objects GetStrinng Method.
strTable = "<TABLE id=TABLE1 cellSpacing=1 cellPadding=1 width='85%' border=1><TR><TD>"
strTable = strTable & ADORec.GetString(2,ADORec.RecordCount,"</TD><TD>","</TD></TR><TR><TD>"
strTable = strTable & "</TABLE>"
strTable = strTable & "<P align=center> <A href=" & txtURL & ">BACK</A></P>"
Response.Write strTable
end if
%>
<P> </P>
</BODY>
</HTML>
----------------------------------------------------------------------------------------------------
When we Debug or RUN the Code from Visual Interv Dev IDE then it doesn't give any error irrespective
of whether the Foxpro database on the Network or on the same machine.
In the DSN we have given the path pointing to the directory containing table .DBF file.
Iam waiting for your reply.
Regards.
Ganesh.