Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically asking the configured ODBC DSNs
Message
 
 
To
06/02/2002 12:58:35
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00615986
Message ID:
00616188
Views:
23
This message has been marked as the solution to the initial question of the thread.
Add the following to the class:
   PROCEDURE GetAllUserDSN
      private oRegistry
      local lcRegSubKey, lcRegHKey, lnVals, laVals[1,2]
      oRegistry   = This.oRegistry  && the registry class use the oRegistry object
      lcRegSubKey = "Software\ODBC\ODBC.INI\ODBC Data Sources"
      lcRegHKey   = HKEY_CURRENT_USER
      lnVals      = oRegistry.GetEnumValues(@laVals, lcRegHKey, lcRegSubKey)
      IF lnVals > 0
         ACOPY(laVals, This.aUserDSNs)
      ENDIF
      return lnVals
   ENDPROC
Modify the class to add the aUserDSNs property:
DEFINE CLASS ODBC as Custom
   *-- class property
   protected oRegistry      && hold reference to the Registry class object
   oRegistry = .null.
   
   DIMENSION aUserDSNs[1]

   *--   
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform