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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using variable in for each cycle

Status
Not open for further replies.

mellthy

Programmer
Dec 6, 2001
17
CZ
Hi,

its quite stupid question i am afraid, but i cant solve it myself.

Using a variable from database query result("columns") shows an error - "Type difference: [String " "]" or something like that.

Here is my code:

For column = 1 To result("columns")
Response.Write "column number"& column
Next

I wonder, if I can use variable in for command ... ?


Thx for help,

Gany
 
Make sure that your value result("columns") is actually a number:

For column = 1 To CInt(result("columns"))
 
Actually when I return value of result("columns") it returns integer - i dont know why ot doesnt work.

Anyway I've added the CInt function and I received quite different error: "Type difference: CInt"

Any other ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top