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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Connecting to a .DBF Table w/ associated .FPT Issue 2

Status
Not open for further replies.

justinpl

Programmer
Nov 20, 2003
19
0
0
US
ASP Connecting to a .DBF Table w/ associated .FPT Issue


I am using ASP to connect to a .DBF Table. The .DBF file is created by either FOX PRO, ADVANTAGE DATABASE SERVER, OR CLIPPER. The .DBF Table can be opened in ASP by using the following code:

---------------------------------------------------

cDataBasePath ="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("\db_directory\safe") & ";" & _
"Extended Properties=""DBASE IV;"";"

Set Con = Server.CreateObject("ADODB.Connection")
Con.Open cDataBasePath

SQLString = "SELECT DISTINCT TAG_ID FROM DATA.DBF"
Set RS = Con.Execute(SQLString)

--------------------------------------------------

Most of the .DBF files will allow this process and return my various queries. The problem is when the .DBF has a field that the data type is set to MEMO. When a MEMO field is present the .DBF file links to a .FPT file to get the value for the MEMO field. So basically every time I try to run the above SQLString if there is a field type of MEMO, the page will produce an error message that says, "EXTERNAL TABLE IS NOT IN THE EXPECTED FORMAT".

I would like to know if there is a way to access these files with or without referrencing the .FPT file? Please help....

Thanks
 
Hi, rgbean, I have a related issue:
updating *.dbf tables from vb.net and getting the same ("External table not in the expected format") error. Can you post the exact syntax to use for VFPOLEdB provider? My *.dbf tables are free-structure (not contained in *.dbc). This is what I have now:

Code:
Dim connDBF As OleDb.OleDbConnection
Dim command As OleDb.OleDbCommand
Dim myReader As OleDb.OleDbDataReader
connDBF = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Update;Extended Properties = dBase IV")            
connDBF.Open()             
command = New OleDb.OleDbCommand("Select * from m11.DBF", connDBF)
myReader = command.ExecuteReader()
While myReader.Read
      ...
End While
myReader.Close()
connDBF.Close()

TIA!
 
DB IV tables are NOT the same as VFP tables - even "free" ones. shows the following as an example:
Code:
oConn.Open "Provider=vfpoledb;" & _ 
           "Data Source=C:\vfp7\Samples\Data\myVFPDB.dbc;" & _ 
           "Mode=ReadWrite|Share Deny None;" & _ 
           "Collating Sequence=MACHINE;" & _ 
           "Password=''"
For more information, see: Microsoft OLE DB Provider for Visual FoxPro 8.0 -
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top