Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Error connecting Fox2.5 database on Network.....

Status
Not open for further replies.

bcss

Programmer
Nov 10, 2000
1
0
0
IN
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=&quot;True&quot;%>
<HTML>
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
</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(&quot;txtFirstName&quot;)
txtLastName = Request.Form(&quot;txtLastName&quot;)
dtmDOB = Request.Form(&quot;dtmDOB&quot;)
txtLogin = Request.Form(&quot;txtLogin&quot;)
txtPassword = Request.Form(&quot;txtPassword&quot;)
txtURL = Request.QueryString(&quot;URL&quot;)

'Setting then Connection object properties.
ADOConn.ConnectionString = Application.Contents(&quot;FOX25_ConnectionString&quot;)
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(&quot;OP&quot;)))
'According to the operation to be performed the required SQL Query is created.
dim strSQL
Select Case Operation
case &quot;CREATE&quot;
strSQL = &quot;Insert into Emp&quot;
strSQL = strSQL & &quot; (FIRSTNAME, LASTNAME, DOB, LOGIN, PASSWD)&quot;
strSQL = strSQL & &quot; Values ('&quot; & txtFirstName & &quot;','&quot;
strSQL = strSQL & txtLastName & &quot;',ctod('&quot; & dtmDOB & &quot;'),'&quot;
strSql = strSql & txtLogin & &quot;','&quot; & txtPassword & &quot;') &quot;
case &quot;READ&quot;

strSQL = &quot;Select * From EMP&quot;
strListCol = &quot;&quot;
case &quot;UPDATE&quot;
case &quot;DELETE&quot;
case else
end Select



if Operation = &quot;CREATE&quot; or Operation = &quot;UPDATE&quot; or Operation = &quot;DELETE&quot; 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 = &quot;<TABLE id=TABLE1 cellSpacing=1 cellPadding=1 width='85%' border=1><TR><TD>&quot;
strTable = strTable & ADORec.GetString(2,ADORec.RecordCount,&quot;</TD><TD>&quot;,&quot;</TD></TR><TR><TD>&quot;)
strTable = strTable & &quot;</TABLE>&quot;
strTable = strTable & &quot;<P align=center>&nbsp;<A href=&quot; & txtURL & &quot;>BACK</A></P>&quot;


Response.Write strTable
end if
%>
<P>&nbsp;</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.
 
We aren't going web server yet. That's next. However, to get the controls going where we want them to....

1. we used Dbase IV drivers.
2. ADO controls
3. SQL string through the properties, connecting to 8 the unknown data type.

The Foxpro tables are huge, one is 1.7 gig. They are used in a peer to peer environment.

A friend just set up a shell in Access to pull the desired data and schedule this whenever.

So, now what we can do is to use the shell, get the required information out of these big files on a scheduled basis.

We had previously written the programs that will use the data.

Next step is IIS and stick the whole thing on the web.
 
To ask a silly question: the VFP driver does support FP2.x files does it?
My first guess would be would Virgo has done: using the ODBC DBase driver instead of the VFP driver.
 
The VFP drivers do support FP 2.x according to the documentation.

However, if the files are very big or if there are only a few fields that are wanted and there are a number of variables in the file, DB4 drivers work out a lot better.
 
Im doing much the same thing and get the same error. I'm attempting to pump data from fp2.6 to sql server 2000 using data transformation services in sql2k. if I manually execute the datapump inside sql2000 it works fine. If i schedule it to run automatically it bombs. I think that there is a permissions problem with accessing fp2.6 but i can't nail it down.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top