First some good troubleshooting hints so in the future you can get further ahead by yourself:
When something doesn't work, disable error skipping stuff like "on error resume next" which just tend to cover up the problems, sweeping them under the rug as it were...
Echo important variables as you go along to make sure they are getting set as you expect: what is the "query" variable, is it the string you are expecting?
Response.Write "inside Database Recordset Loop, query has a value of" & query & "<br />" & VbCrLf
If not, echo each of the three pieces and see if one or more is not getting passed from the form.
I don't understand the
Code:
Call data.MoveNext()
Wend
Call data.Close()
Call objConn.Close()
part at all, what are you trying to do here?
Use flags along the way, to signal how far you get, like echoing when you enter and after you leave key loops or control structures:
Response.Write "inside Database Query Section<br />" & VbCrLf
Response.Write "inside Database Recordset Loop<br />" & VbCrLf
Response.Write "Database Connection just closed successfully<br />" & VbCrLf
etc. etc.