Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to export from within Access to VFP table
Message
From
31/10/2001 15:07:34
 
 
To
31/10/2001 14:10:44
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00575798
Message ID:
00575828
Views:
17
>Hi. I have a client that wants me to integrate their Microsoft Access program (2000) with my accounting program (VFP6.). They want to add a record to my customer table whenever they add a record to their customer table. I want to give them a program (COM?) that they can execute from within their app that will build the record in my table using the validation rules I need. I will write the program and give a compiled version to them and they will call it from their app. What is the best way to do this? I have never used COM objects before so my interconnectivity knowledge is weak. Please help.
>
>Thanks.
>
>Sandi Cassidy
>scassidy@canaccount.com

You have at least two options:
1) Build a COM server as you were considering.
2) Use the VFP ODBC driver from within the Access database to insert the new record.

A simple COM server that will do this would look like:
Define Class myServer As Custom OlePublic
  Proc SaveData
    LParameters val1, val2, val3

    Local lRetVal

    *-- validation code goes here, sets lRetVal .T. or .F.
    If lRetVal Then
      Insert Into myTable Values(val1, val2, val3)
    Endif

    Return lRetVal
  EndProc
EndDefine
Of course there is more to it than this, (like making sure myTable is in the COM server's path) but it gives the general idea. You can build a COM EXE or a COM DLL for this. Shouldn't make much difference if you will distribute it to all clients running the Access application. From within the access code, you would:
Set oSrv = CreateObject("myProjectname.myServer")
bFlag = oSrv.SaveData(var1, var2, var3)
Set oSrv = Nothing
Also on MSDN read the article "Building Three-Tier Client/Server Applications with Visual FoxPro". It's an old article but should give you some ideas on building COM servers.
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform