Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB needs more data power!
Message
De
27/06/2000 11:20:10
 
 
À
27/06/2000 10:50:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00385060
Message ID:
00385088
Vues:
9
Hi Kenneth,

Look in HTML Help under "Controlling Visual FoxPro from Other Applications". It goes into how to manipulate VFP in a variety of ways from outside of VFP including Automation and OLE. Also look at the help files for VFPCOM, which can be found in VFPCOM directory just off the main VFP98 folder.

A really simple example of a DLL in VFP for getting, say, the total of invoice lines from a table would be:
DEFINE CLASS invoice AS Custom OLEPUBLIC
   PROCEDURE getlinetotal(cInvNumber)
      USE invlines
      CALCULATE SUM(amount) FOR invnum = cInvNumber TO nTotal
      USE IN invlines
      RETURN nTotal
   ENDPROC
ENDDEF
Create a project and have this code, in a PRG, as your code. Compile into a DLL called finance.dll. From VB....

Dim oFinance As Object
Set oFinance = CreateObject("Finance.Invoice")
numTotalAmount = oFinance.GetLineTotal "0000001"

>I have been working using Visual FoxPro 6 for about a month now and I am proud to say I am loving it. Its very powerful in the database department plus great speed is pretty exciting.
>
>So far tables for my "learning" applications have been small in record count, but many have told me that Fox can search millions of records with ease if setup properly. I remember the term "Rushmore" being thrown around--I understand they are not talking about the rock now!
>
>Well, here is the question I have for all of you. I have a bit more experience with Visual Basic than I do VFP6 and I would like to have the power of VFP's data management accessible from VB. Is it possible for me to create a DLL that would easily be accessed from within VB6 for database management of *.dbf file?
>
>I noticed under the build option that you can create a Single or Multi threaded COM DLL server from within VFP and I was wondering how to get started using these.
>
>Thanks for all advice, comments, and suggestions.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform