Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto create odbc
Message
 
À
19/04/2004 03:57:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00896018
Message ID:
00896035
Vues:
16
Easiest way (for me) is to use of Cursor Adapters, if you use VFP 8 (I am not sure if that class eist in VFP 7 because I never use it). Create a class based on Cursor Adapter & use a builder to build it.

2. You can use SQLSTRINGCONNECT() function to establish a connection to Your DB & then use SQLEXEC for obtaining a records of the tables of that DB.
i.e. if the DB is SQL Server DB
 * Change YOURSQLSERVERDB to the actual name of the DB
 * Cange YOURSQLSERVERNAME to the actual name of the SQL Server
 * Chaneg MyDBUser to the user name & MyDbPass to the password assosiated to that user
 sqlH = SQLSTRINGCONNECT("DRIVER=SQL Server;UID=MyDBUser;PWD=MyDbPass;DATABASE=YOURSQLSERVERDB;WSID=VLADO;APP=MyApplication;SERVER=YOURSQLSERVERNAME")

IF sqlH < 0
   MessageBox("Can not establish a connection")
   RETURN
ENDIF

sqlResult = SQLEXEC(sqlH, "SELECT * FROM MyTable", "MyLocalCursor")
IF sqlResult < 0
   MessageBox("Can not select a reords")
   SQLDISCONNECT(sqlH)
   RETURN
ENDIF
****
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform