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:42:17
 
 
To
31/10/2001 15:07:34
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00575798
Message ID:
00575851
Views:
27
Is there a way to validate certain fields (like State & Country) against VFP tables from Access? What about generating the next number for Customer Numbers?

Sandi.


************
>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