Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enum. ODBCs available
Message
 
 
À
13/06/2007 11:40:40
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 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MySQL
Divers
Thread ID:
01232563
Message ID:
01232657
Vues:
13
>>this should do the trick ..
>>
>>DECLARE SHORT SQLDrivers IN odbc32;
>>    INTEGER   EnvironmentHandle,;
>>    INTEGER   Direction,;
>>    STRING  @ DriverDescription,;
>>    INTEGER   BufferLength1,;
>>    INTEGER @ DescriptionLengthPtr,;
>>    INTEGER   DriverAttributes,;
>>    INTEGER   BufferLength2,;
>>    INTEGER   AttributesLengthPtr
>>
>>
>>LOCAL lnRet, lnEnvHandle, lcDriver, lnBufferLen, lnCount, laDrivers[1]
>>lnEnvHandle = VAL(SYS(3053))
>>lnBufferLen = 1024
>>lcDriver = REPLICATE(CHR(0),lnBufferLen)
>>lnRet = SQLDrivers(lnEnvHandle, 2, @lcDriver, lnBufferLen, @lnBufferLen, 0, 0, 0)
>>
>>lnCount = 1
>>DO WHILE lnRet = 0
>>	DIMENSION laDrivers[lnCount]
>>	laDrivers[lnCount] = LEFT(lcDriver,lnBufferLen)
>>	lnCount = lnCount + 1
>>	lnBufferLen = 1024
>>	lcDriver = REPLICATE(CHR(0),lnBufferLen)
>>	lnRet = SQLDrivers(lnEnvHandle, 1, @lcDriver, lnBufferLen, @lnBufferLen, 0, 0, 0)
>>ENDDO
>>
>>?'MySql ODBC driver is ' + IIF(ASCAN(laDrivers,'MySQL',1,-1,1,1+4+8) > 0,'installed','not installed')
>>
>
>Hi Christian..
>
>wow, seems great that solution.. Here at my PC (with XP) works fine.. What about in dif. systems (as Vista), did you already tried ?
>
>thanks..
>
>Claudio

I got different results using both methods: (using code by Martin /Sergey):

Using SQLDrivers:

1 Microsoft Access Driver (*.mdb) UsageCount=3 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=2 FileExtns=*.mdb SQLLevel=0
2 Microsoft Excel Driver (*.xls) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.xls SQLLevel=0
3 Microsoft dBase Driver (*.dbf) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.dbf,*.ndx,*.mdx SQLLevel=0
4 Microsoft Paradox Driver (*.db ) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.db SQLLevel=0
5 Microsoft Visual FoxPro Driver UsageCount=3 APILevel=0 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.dbc,*.dbf SQLLevel=0
6 Microsoft FoxPro VFP Driver (*.dbf) UsageCount=2 APILevel=0 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.dbf,*.cdx,*.idx,*.fpt SQLLevel=0
7 Microsoft dBase VFP Driver (*.dbf) UsageCount=2 APILevel=0 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.dbf,*.cdx,*.idx,*.fpt SQLLevel=0
8 Microsoft Access-Treiber (*.mdb) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=2 FileExtns=*.mdb SQLLevel=0
9 Microsoft Excel-Treiber (*.xls) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.xls SQLLevel=0
10 Microsoft dBase-Treiber (*.dbf) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.dbf,*.ndx,*.mdx SQLLevel=0
11 Microsoft Paradox-Treiber (*.db ) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.db SQLLevel=0
12 Microsoft Visual FoxPro-Treiber UsageCount=2 APILevel=0 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.dbf,*.cdx,*.idx,*.fpt SQLLevel=0
13 Driver do Microsoft Access (*.mdb) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=2 FileExtns=*.mdb SQLLevel=0
14 Driver do Microsoft Excel(*.xls) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.xls SQLLevel=0
15 Driver do Microsoft dBase (*.dbf) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.dbf,*.ndx,*.mdx SQLLevel=0
16 Driver do Microsoft Paradox (*.db ) UsageCount=2 APILevel=1 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.db SQLLevel=0
17 Driver para o Microsoft Visual FoxPro UsageCount=2 APILevel=0 ConnectFunctions=YYN DriverODBCVer=02.50 FileUsage=1 FileExtns=*.dbf,*.cdx,*.idx,*.fpt SQLLevel=0
18 Microsoft ODBC for Oracle UsageCount=1 SQLLevel=1 FileUsage=0 DriverODBCVer=02.50 ConnectFunctions=YYY APILevel=1 CpTimeout=120
19 SQL Native Client UsageCount=1 APILevel=2 ConnectFunctions=YYY CPTimeout=60 DriverODBCVer=09.00 FileUsage=0 SQLLevel=1

Using Registry class:

1 SQL Server
2 Microsoft Access Driver (*.mdb)
3 Microsoft Text Driver (*.txt; *.csv)
4 Microsoft Excel Driver (*.xls)
5 Microsoft dBase Driver (*.dbf)
6 Microsoft Paradox Driver (*.db )
7 Microsoft Visual FoxPro Driver
8 Microsoft FoxPro VFP Driver (*.dbf)
9 Microsoft dBase VFP Driver (*.dbf)
10 Microsoft Access-Treiber (*.mdb)
11 Microsoft Text-Treiber (*.txt; *.csv)
12 Microsoft Excel-Treiber (*.xls)
13 Microsoft dBase-Treiber (*.dbf)
14 Microsoft Paradox-Treiber (*.db )
15 Microsoft Visual FoxPro-Treiber
16 Driver do Microsoft Access (*.mdb)
17 Driver da Microsoft para arquivos texto (*.txt; *.csv)
18 Driver do Microsoft Excel(*.xls)
19 Driver do Microsoft dBase (*.dbf)
20 Driver do Microsoft Paradox (*.db )
21 Driver para o Microsoft Visual FoxPro
22 Microsoft ODBC for Oracle
23 INTERSOLV 3.00 32-BIT ParadoxFile (*.db)
24 INTERSOLV 3.11 32-BIT ParadoxFile (*.db)
25 SQL Native Client


E.g. the registry class returned more drivers for some reason.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform