Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to export from within Access to VFP table
Message
De
31/10/2001 15:49:42
 
 
À
31/10/2001 15:42:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00575798
Message ID:
00575857
Vues:
18
As I was saying, if there is no issue with doing everything from the Access side, you can just use the VFP ODBC driver to open tables and modify data or lookup values on VFP tables. If the customer number is in Access autonumber field then you should insert it in Access first and then use the number to update the VFP table via the ODBC driver.

It depends on which approach you want to take.

>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform