Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Please help with connecting Visual Foxpro tables


Message #1 by jamesbkim@h... on Tue, 11 Dec 2001 18:04:59

Hello fellows,



I'm trying to use Visual Foxpro tables which are in the other server.

My asp pages are in Win2000 server, 

and the VFP tables are in different server with NT 4.0.

How can I connect to the NT server and get the VFP tables?

I'm keep getting error messages like this;



Error Type:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

[Microsoft][ODBC Visual FoxPro Driver]Fox Error 1



Also, is it possible to get VFP tables over the Internet not in LAN?

Any sample codings or suggestions will be very appreciated!



James



Message #2 by gbrown@c... on Fri, 14 Dec 2001 11:53:06
Hi James



Suggest posting the error and a snippet of the code that generated the 

error. 



Not come across a fox error 1 before.



Regards

Graham



> 

> Hello fellows,

> 

> I'm trying to use Visual Foxpro tables which are in the other server.

> My asp pages are in Win2000 server, 

> and the VFP tables are in different server with NT 4.0.

> How can I connect to the NT server and get the VFP tables?

> I'm keep getting error messages like this;

> 

> Error Type:

> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

> [Microsoft][ODBC Visual FoxPro Driver]Fox Error 1

> 

> Also, is it possible to get VFP tables over the Internet not in LAN?

> Any sample codings or suggestions will be very appreciated!

> 

> James

> 

Message #3 by jamesbkim@h... on Sat, 15 Dec 2001 01:03:32

Here is the pages.

I have the foxpro connection string page and include it 

in the department page to get the data from visual foxpro tables.

However, I get the following error message.



Error Type:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

[Microsoft][ODBC Visual FoxPro Driver]Fox Error 1



How can I solve this problem?





- Connection.asp



<%

'//-------------------------------------------------------

  Function GetFoxProConnection()

'//-------------------------------------------------------

'// Description ... Returns Connection Object

'// ............... 

'// ...............

'// Parameter(s) .. None

'// ...............

'// Return Value .. Connection Object

'// ...............

'// Changes .......

'// ...............

    Const ADO_CONNECTION_CLASS       = "ADODB.Connection"



    Set objConnection = Server.CreateObject(ADO_CONNECTION_CLASS)



    strOpenString = "Driver=Microsoft Visual Foxpro Driver; " & _

                    "UID=; " & _

                    "SourceType=DBF; " & _

                    "SourceDB=server/folder/foxprotables/"



    objConnection.Open(strOpenString)



    Set GetFoxProConnection = objConnection

  End Function

%>





- Department.asp



<!--#include file="Connection.asp"-->

<HTML>

<HEAD>

<TITLE>Department</TITLE>

</HEAD>

<BODY bgcolor='cc3300'>



<%



Dim rsDeptno, objconnection, strdeptno

strSQL = "Select * from jedeptno " & _

          "order by sortno; "



Set objconnection = server.CreateObject("adodb.connection")

Set rsDeptno = server.CreateObject("adodb.recordset")



Set objconnection = getfoxproconnection



 rsDeptno.open strSQL, objconnection

 

 IF Not rsDeptno.EOF Then

  DO WHILE NOT rsDeptno.EOF

    Response.Write "<TABLE>"

    Response.write _

    "<TR><TD align='center'><a target='mainframe' href=""SetDept.asp?

strdeptno=" & rsdeptno("deptno") & "&strcompid=" & rsdeptno("compid") 

& """><img border='0' align='center' src='" & rsdeptno("path") 

& "'></a></td>" & _

    "</TR>"

    rsDeptno.MoveNext

  LOOP

  Response.Write "</TABLE>"

 ELSE

  Response.Write "<center><h5>** No Department currently defined. 

**</h5></center>"

 END IF



 rsDeptno.close

 Set rsDeptno = Nothing



%>



<br>

</BODY>

</HTML>




  Return to Index