Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1999-10-11
2
Medium Priority
?
182 Views
Last Modified: 2013-12-25
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.

Thanks.

Pepe Hernandez
0
Comment
Question by:al361345
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Expert Comment

by:charlescope
ID: 2118264
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
0
 
LVL 7

Accepted Solution

by:
simonsabin earned 400 total points
ID: 2160482
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.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question