Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB constants adXXXXX not available

Status
Not open for further replies.

PeDa

Technical User
Oct 10, 2002
227
NL
Trying to use ADO in my Visual Basis Express 2010 project. I have included a reference to "Microsoft ActiveX Data Objects 6.1 Library" and this works:
Code:
Public con As New ADODB.Connection
The various adXXX variables are however not available:
Code:
Public Enum rrCursorType
 rrOpenDynamic = adOpenDynamic
 rrOpenForwardOnly = adOpenForwardOnly
 rrOpenKeyset = adOpenKeyset
 rrOpenStatic = adOpenStatic
End Enum
Do I have to add another reference?
 
This is just my guess here (because I did try it myself).
Are you re-writing a VB 6 code into a VB.NET application and want to stick with what you know, i.e. ADODB? If so, I would suggest to learn ADO.NET and re-do you work the way it should be written in VB.NET Once you learn ADO.NET it is a lot simpler and you can do a lot more with ADO.NET

Just a suggestion ... :)

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Hello Andy,
Good guess! In the meantime I have found the actual numerical constants on internet and am using these, but I do appreciate that this isn't going to win any prizes. Luckily it's just a little something for myself. I do agree that ADO.NET is the way to go.
Peter
 
a little something for myself" is the best way to learn ADO.NET, IMHO. :)

BTW, you can find the values yourself. Open new Project in VB 6, add Microsoft ActiveX Data Objects 6.1 Library, and run code - something like this:

Code:
Debug.Print "adOpenDynamic - " & adOpenDynamic
Debug.Print "adOpenForwardOnly - " & adOpenForwardOnly
Debug.Print "adOpenKeyset - " & adOpenKeyset
Debug.Print "adOpenStatic - " & adOpenStatic

you get:
[tt]
adOpenDynamic - 2
adOpenForwardOnly - 0
adOpenKeyset - 1
adOpenStatic - 3
[/tt]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top