Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating and ODBC programatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows XP
Network:
Windows 2000 Pro
Database:
MS SQL Server
Divers
Thread ID:
00967875
Message ID:
00969716
Vues:
11
as I said
"sqlstring conection is not an option,"
but thnks


>>I need to create a system odbc connection programatically. sqlstring conection is not an option,
>>
>>it shoudl be something like this
>>run a loader
>>the loader creates the odbc depending in a selection the user makes
>>the loader runs the main program
>>the main program uses the odbc
>>
>>
>>i only need the code to create the odbc though
>
>In my forms Load:
>
>
>STORE SQLSTRINGCONNECT('Driver={SQL SERVER};Server=MyServer;Database=MyDatabase;uid=MyUser;pwd=MyUser');
>	   TO gnConnHandle
>IF gnConnHandle < 0
>   = MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
>ELSE
>     Thisform.pConnection = gnConnHandle
>ENDIF
>
>
>
>On the Form create a Property called pConnection
>
>In your search method:
>
>
>Local tConnection
>tConnection = Thisform.pConnection
>
>*	You can use different ways to get the data – here is one using SQL Passthru
>
>SQLEXEC(tConnection, 'SELECT * FROM MyTable ', 'cMyTable')
>
>
.......
DO WHILE .T.
      ME.Work()
ENDDO
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform