jessy_houle
asked on
VBS - Copy Enumerations names and values into an array
In VBS, I would like to use an Enumeration value in VBS without the worry of it changing with the next version of the DLL. I have an example below of using the adUseClient Enumeration value with the Connection object. I realize that Microsoft will not ever change adUseClinet from 3 to any other number, but other 3rd party objects may.
What I'm looking for is a workaround... possibly storing Enumeration names and values in a multidimensional array, etc. Any other thoughts and comments are encouraged.
'------------------------- -----
'this produces an error
'because of adUseClient
'------------------------- -----
dim ob
dim adUseClient
set ob = CreateObject("ADODB.Connec tion")
ob.Open "Provider=sqloledb;Data Source=dsd3dba;Integrated Security=SSPI"
ob.CursorLocation = adUseClient
set ob = Nothing
msgbox "done"
'------------------------- -----
Thank you.
Jessy Houle
What I'm looking for is a workaround... possibly storing Enumeration names and values in a multidimensional array, etc. Any other thoughts and comments are encouraged.
'-------------------------
'this produces an error
'because of adUseClient
'-------------------------
dim ob
dim adUseClient
set ob = CreateObject("ADODB.Connec
ob.Open "Provider=sqloledb;Data Source=dsd3dba;Integrated Security=SSPI"
ob.CursorLocation = adUseClient
set ob = Nothing
msgbox "done"
'-------------------------
Thank you.
Jessy Houle
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.