Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connect to VPF table from VB
Message
De
24/12/2000 10:42:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00456653
Message ID:
00456673
Vues:
17
>Hi all,
>
>How do you connect to a database or free table in VFP from VB?
>what would be the connectionstring like or Where can I find a example?
>
>Thanks

Lal,
I'm not a VB user so you might need highly rectify what I say here.
-Create a new project (form I mean)
-Open data view window and add DE to project
-In DE rightclick connection1 and select properties
-Slect OLE DB for ODBC drivers (in near future there will be OLE DB for VFP:)
-Click next and select 'use connection string' and click build
-Select machine data sources and Visual foxpro database and click OK
-Select DBC (left) and point to a DBC
-If you need select next and set access mode and click OK

Now a connection is set. Click on connection1 and 'add command'. In command property pages select 'Database oject' as table and in 'object name' select a table from list.

Click and drag the 'command' you added (named to command1 by default) on form. This would create fields with captions there.

From project\components add 'MS Ado data control' to project and form. On form right click ADODc1 (default name) and select properties. There click 'Build' and build the connection string in the same as above.

Select all textbox controls you created by drag&drop from DE. Go to properties sheet and delete their 'Datamember' and set their 'DataSource' to AdoDC1 from list.

I think you're done and from there on know better than me how to proceed in VB :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform