• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

Append an existing table to a FoxPro database from Visual Basic 5.0

I have this code:

Dim FoxProtable as tabledef
Dim FoxProbase as database
Set foxprobase = opendatabase("c:\sig",false,false,"FoxPro 3.0")
Set foxprotable = foxprobase.createtabledef("Age")
Foxprotable.connect = "Foxpro 3.0;Database=C:\sig")
Foxprotable.sourcetablename = "Agencias"
Foxprobase.tabladefs.append Foxprotable

In this line, an error is displayed "This operation is not
supported for this kind of object"

I want to access a foxpro table and an error message appear, "You cant have access to the dependent DBF FoxPro 3.0 file".

I only use the first idea as a solution for this problem. But it is my real problem.

I hope your answers soon.


Pepe Hernandez
1 Solution
Try the Create table SQL keyword.

Create Table NewTable(Field1 Text(30), Field2 Integer)

Connect to foxpro 3 using ADO and following code.
    Dim strConnect          As String
    Dim strDatabasePath     As String

'-- Set the Source to the database file
    strDatabasePath = "C:\My Documents\Data\Books.dbc"
'-- Create the connection object
    Set objConnection = New ADODB.Connection
'-Build our connection string to use when we open the connection
    strConnect = "DRIVER=Microsoft Visual FoxPro Driver;UID=;Deleted = Yes;Null=Yes;" & _
                 "Collate = Machine;BackgroundFetch = Yes;Exclusive = No;SourceType = DBC;SourceDB=" & strDatabasePath
'-- Open the connection
    objConnection.Open strConnect
Cannot be done the way you want.

To add a table, export an access/excel table to the foxpro directory in foxpro format and heh presto you will have a foxprot table as you want it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now