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!

Getting "Constant Expression Required" for an Enum 1

Status
Not open for further replies.

Galford

Programmer
Jan 5, 2001
13
US
I have the following enumeration defined in a class:

'Class module to handle connection to database
Public Enum DBLoc
DBLocal = 1
DBServer = 2
End Enum

From time to time, I'll get a compile error stating Constant Expression Required even though it is defined in the class.

Is this a bug or did I do something wrong? Any help would be appreciated.

Thanks
 
the following code appears in the loginscreen form:

cCon.ExecuteCommand "qryLogin", rsSecurity, True, cmdSecurity, False, True, DBServer

ccon is a connection class. This is where the enumeration(found in my initial posting) is defined.

This is also the spot where the the program breaks and gives the error. If I hit F8 it jumps to the next spot it finds DBServer and gives the error again.

To fix the problem, I close VB then open it right back up, and it works fine for a while till it decides to do it again.

- Galford
 
Did you close you connection object within your ccon class?

Did you declare the arguement where you pass in "DBServer" as a "DBLoc"?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top