Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: prasanna kunder
  Where is prasanna kunder?
 mumbai
 India
 prasanna kunder
 Tags
Subject: Convert Code VB to VFP
Thread ID: 373900 Message ID: 373900 # Views: 63 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Thursday, March 28, 2013 5:59:17 PM         
   


Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."

Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers"
objRegistry.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValueNames, arrValueTypes

For i = 0 to UBound(arrValueNames)
strValueName = arrValueNames(i)
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
Wscript.Echo arrValueNames(i) & " -- " & strValue
Next

edited i got
but it's work on all Windows OS

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
lnEnvHandle = VAL(SYS(3053))
lnBufferLen = 1024
lcDriver = REPLICATE(CHR(0),lnBufferLen)
lnRet = SQLDrivers(lnEnvHandle, 2, @lcDriver, lnBufferLen, @lnBufferLen, 0, 0, 0)

CREATE CURSOR crsDrivers (Name CHAR (100))
lnCount = 1
DO WHILE lnRet = 0
INSERT INTO crsDrivers VALUES(LEFT(lcDriver,lnBufferLen))
lnBufferLen = 1024
lcDriver = REPLICATE(CHR(0),lnBufferLen)
lnRet = SQLDrivers(lnEnvHandle, 1, @lcDriver, lnBufferLen, @lnBufferLen, 0, 0, 0)
ENDDO
GO TOP
BROWSE NORMAL

ENTIRE THREAD

Convert Code VB to VFP Posted by prasanna kunder @ 3/28/2013 5:59:17 PM