ASP.NET 1.0 and 1.1 BasicsASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
for hh = 1 to 20
SQL2= "select * from mega where sta_1 <= '"&hh&"' and stp_1 >= '"&hh&"' "
set ts = conn.execute(SQL2)
do while not ts.eof
b = b + 1
ts.movenext
The problem is that the code will execute perfect for hh= 1 to 9, but recognises 10, 11, 12... as values less than 2. Hence the over all result will not be perfect.
Can anyone help me force the machine to recognise 10, 11, 12 etc as their true values i.e greater than 9. It seems that the code is interpreting them as a text and not as a number. I tried changing the field value in the Acces DB to "number" from "text" but it will return an error of "data type mismatch in criteria expression"
Peter,
I tried it and it gave me this error:
Wrong number of arguments or invalid property assignment: 'string'
on the line set ts = conn.execute(string.format(SQL2, hh))
What language are you working in? I realize after re-reading the post that your use of "conn.execute" and ".eof" lead me to believe you are not in a .NET language.