Hi,
I've read the manual, but this won't work! I do not understand why. The array needs to be as big as the RecordCount of the sql-result.
I get these errors:
Integer expected (first problem)
Subscript out of range (second problem)
So.... what to do to make the server understand that 'aantal' is an integer? Dim myArray(cInt(aantal)) isn't working... and why doesn't the array accept the value of the first array?
Thanks in advance!
Quasibobo
Don't eat yellow snow!
I've read the manual, but this won't work! I do not understand why. The array needs to be as big as the RecordCount of the sql-result.
Code:
Set Projecten_query = Server.CreateObject( "ADODB.Recordset" )
Projecten_query.CursorType = adOpenStatic
Projecten_query.ActiveConnection = Con
Projecten_query.Open = "SELECT ID FROM project WHERE DivisieID = " & DivisieID & " AND Niveau = 0 ORDER BY ID DESC"
aantal=Projecten_query.RecordCount
' Create Array with all the Projects with that DivisionID.
Dim myArray(aantal) 'first problem
myArray(0) = "0" 'second problem
FOR i=1 TO aantal
ProjectIDS = Projecten_query("ID")
myArray(i)= ProjectIDS
NEXT
I get these errors:
Integer expected (first problem)
Subscript out of range (second problem)
So.... what to do to make the server understand that 'aantal' is an integer? Dim myArray(cInt(aantal)) isn't working... and why doesn't the array accept the value of the first array?
Thanks in advance!
Quasibobo
Don't eat yellow snow!