Newsgroup: it.comp.lang.vo-clipper
Titolo: ODBC help

Salve a tutti.
E' un argomento gia' trattato...ma non riesco piu' a trovarlo.
Qualcuno sarebbe disposto a ripostare la routine per installare e
configurare i driver ODBC a runtime?
grazie per la pazienza
riccardo

 configurare i driver ODBC a runtime?
Per quale DataBase, per MySql la trovi in
http://www.softdevo.com/vo/allavoro.htm
Danilo Giuliani


 ha scritto nel messaggio
news:lwx0a.141284$0v.39...@news1.tin.it...



La stiamo utilizzando adesso, e funziona veramente bene!!!
Grazie, Danilo
Ciao, Marino

Ecco qui
La funzione mostra la trovi 
http://www.softdevo.com/vo/utilita.htm
FUNCTION SettaDbfODBC(cNome AS STRING) AS LOGIC
LOCAL lRes AS LONG
LOCAL hKey AS DWORD
LOCAL dwDis AS DWORD
LOCAL pszSubKey AS PSZ
LOCAL cPrg AS STRING
// Per settare gli ODBC //
IF IsClass(#ReportQueue)
 pszSubKey := PSZ(_CAST,  "Software\ODBC\ODBC.INI\"+cNome)
 lRes := RegCreateKeyEx(HKEY_CURRENT_USER, pszSubKey, 0,;
     PSZ(_CAST, "STRING"), REG_OPTION_NON_VOLATILE,KEY_SET_VALUE,;
    NULL, ;
    @hKey, @dwDis)
 IF lRes != ERROR_SUCCESS
  Mostra("Errore nell'apertura del file di registro di Windows ("+cNome+")")
  RETURN FALSE
 ENDIF
 IF dwDis == REG_CREATED_NEW_KEY
  RegSetValueEx(hKey, PSZ(_CAST, "CacheSize"), 0, REG_SZ, PSZ(_CAST, "4"),
3)
  RegSetValueEx(hKey, PSZ(_CAST, "CreateType"), 0, REG_SZ, PSZ(_CAST,
"FoxPro25"),10)
  RegSetValueEx(hKey, PSZ(_CAST, "Database"), 0, REG_SZ, PSZ(_CAST, " "), 3)
  RegSetValueEx(hKey, PSZ(_CAST, "Description"), 0, REG_SZ, PSZ(_CAST, "
"),3)
  RegSetValueEx(hKey, PSZ(_CAST, "Driver"), 0, REG_SZ, PSZ(_CAST,
"C:\CA_APPSW\C3DBF13.DLL"),25)
  RegSetValueEx(hKey, PSZ(_CAST, "FileOpenCache"), 0, REG_SZ, PSZ(_CAST,
"0"), 3)
  RegSetValueEx(hKey, PSZ(_CAST, "IntlSort"), 0, REG_SZ, PSZ(_CAST, "0"),3)
  RegSetValueEx(hKey, PSZ(_CAST, "LockCompatibility"), 0, REG_SZ, PSZ(_CAST,
"dBASE"),7)
  RegSetValueEx(hKey, PSZ(_CAST, "Locking"), 0, REG_SZ, PSZ(_CAST, "NONE"),
6)
  RegSetValueEx(hKey, PSZ(_CAST, "UseLongNames"), 0, REG_SZ, PSZ(_CAST,
"0"), 3)
  RegSetValueEx(hKey, PSZ(_CAST, "UseLongQualifiers"), 0, REG_SZ, PSZ(_CAST,
"0"),3)
 ENDIF
 RegCloseKey(hKey)
 pszSubKey := PSZ(_CAST,  "Software\ODBC\ODBC.INI\ODBC Data Sources")
 lRes := RegCreateKeyEx(HKEY_CURRENT_USER, pszSubKey, 0,;
     PSZ(_CAST, "STRING"), REG_OPTION_NON_VOLATILE,KEY_SET_VALUE,;
    NULL, ;
    @hKey, @dwDis)
 IF lRes != ERROR_SUCCESS
  Mostra("Errore nell'apertura del file di registro di Windows (ODBC Data
Sources)")
  RETURN FALSE
 ENDIF
 IF dwDis == REG_CREATED_NEW_KEY
  RegSetValueEx(hKey, PSZ(_CAST, cNome), 0, REG_SZ, PSZ(_CAST, "CA Xbase
(*.dbf)"),17)
 ENDIF
 RegCloseKey(hKey)
 pszSubKey := PSZ(_CAST,  "Software\ODBC\ODBCINST.INI\CA Xbase (*.dbf)")
 lRes := RegCreateKeyEx(HKEY_CURRENT_USER, PSZSubKey, 0, ;
     PSZ(_CAST, "STRING"), REG_OPTION_NON_VOLATILE,KEY_SET_VALUE,;
    NULL, ;
    @hKey, @dwDis)
 IF lRes != ERROR_SUCCESS
  Mostra("Errore nell'apertura del file di registro di Windows (CA Xbase
(*.dbf))")
  RETURN FALSE
 ENDIF
 IF dwDis == REG_CREATED_NEW_KEY
  RegSetValueEx(hKey, PSZ(_CAST, "driver"), 0, REG_SZ, PSZ(_CAST,
"C:\CA_APPSW\C3DBF13.DLL"),25)
  RegSetValueEx(hKey, PSZ(_CAST, "setup"), 0, REG_SZ, PSZ(_CAST,
"C:\CA_APPSW\C3DBF13.DLL"),25)
 ENDIF
 RegCloseKey(hKey)
ENDIF
// Fine Per settare gli ODBC //
RETURN TRUE