Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically export ODBC settings from Registry
Message
De
06/02/2008 21:23:13
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01290199
Message ID:
01290281
Vues:
10
This message has been marked as a message which has helped to the initial question of the thread.
Hi Vince.

>Anyone have an idea as to how to export the ODBC setting from the Registry?

You can use the Registry class in the FFC subdirectory of the VFP home directory to read from the various nodes under HKEY_CURRENT_USER\Software\ODBC (for user DSNs) and HKEY_LOCAL_MACHINE\Software\ODBC (for system DSNs), store the values in a table, and then on another machine, read the values from the table and write to those keys in the Registry. A subclass of Registry called ODBCReg is specifically designed to reading from HKEY_CURRENT_USER\Software\ODBC

Here's some starting code:
local loRegistry, ;
  laDataSources[1], ;
  laKeys[1], ;
  lnI, ;
  lcDataSource
loRegistry = newobject('ODBCReg', home() + 'FFC\Registry.vcx')
loRegistry.GetODBCDrvrs(@laDataSources, .T.)
for lnI = 1 to alen(laDataSources, 1)
  lcDataSource = laDataSources[lnI, 1]
  loRegistry.EnumODBCData(@laKeys, lcDataSource)
* do something with the values in laKeys
next lnI
Doug
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform