Please include the source code for the class as well as the exact error message you received.
Main Topics
Browse All Topicshi i have created a class in vbscript class and want to create its objects array
i am trying
set vr = new validationRule()
this is giving me an error
please help!!!!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
he code:
<% OPTION EXPLICIT %>
<!--#include FILE="ADOVBS.INC"-->
<html>
<head>
<title>Validation Test 2</title>
</head>
<body>
<%
'DECLARATIONS
class validationRules
Public validationID
Public validationComponentID
Public validationType
Public validationCriteria
Public validationClientID
Public validationUserGroupID
End class
dim conn
dim rsValidationRules
dim validationRulesArray
dim clientID
dim userGroupID
dim componentID
%>
<%
'INITIATION
clientID = 2
userGroupID = 1
componentID = 13
set validationRulesArray = New validationRules()
Set conn = Server.CreateObject("ADODB
conn.Open "DSN=HMS"
set rsValidationRules = conn.execute ("SELECT * FROM VALIDATION WHERE VALIDATION_COMPONENT_ID="&
validationRulesArray = rsValidationRules.getRows(
%>
</body>
</html>
the error it gives me is
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/krnlOrderEntryCash2.asp, line 35
set validationRulesArray = New validationRules()
I think you will have to do somthing like this
Set validationRulesArray(0) = New validationRules 'do this for each item in array
Look here for another example
http://www.15seconds.com/i
>yeah but i want validationRulesArray to be of class validationRules
That's impossible in VBScript, it can only be done in VBA or full Visual Basic. What you really want and can get is an array filled with validationRules.
Your script is horribly wrong for doing this. Try this:
Dim validationRulesArray()
Dim numArrayRows
Set conn = Server.CreateObject("ADODB
conn.Open "DSN=HMS"
set rsValidationRules = conn.execute ("SELECT * FROM VALIDATION WHERE VALIDATION_COMPONENT_ID="&
numArrayRows = 0
Do While Not rsValidationRules.EOF
numArrayRows = numArrayRows + 1
Redim Preserve validationRulesArray(1 to numArrayRows)
Set validationRulesArray(numAr
validationRulesArray(numAr
validationRulesArray(numAr
validationRulesArray(numAr
validationRulesArray(numAr
validationRulesArray(numAr
validationRulesArray(numAr
rsValidationRules.MoveNext
Loop
conn.Close
This will actually do the job as long as the property names of the validationRule object match the field names of the field values they are being assigned.
Business Accounts
Answer for Membership
by: JonMnyPosted on 2007-01-23 at 08:19:16ID: 18375930
What Error?