Hi all,
I've heard a lot of advice from the gurus of this forum that executing SQL runs much quicker than opening a recordset, setting the field values, and updating.
I was wondering if anybody follows a standard on how to access/manipulate database info.
I'd like to find a way where I don't have to do any major string replacing/formatting to capture user input.
For example: a Last Name field may contain "O'Hare"
If I write a SQL statment there would be a problem because of the ' mark in the name.
Wheras if I used a recordset:
I don't have any problems with whatever content. What if the user accidentally enters double-quotes when I thought I'd be clever and ""escape my doublequote in the sSQL string?
Earnie Eng
I've heard a lot of advice from the gurus of this forum that executing SQL runs much quicker than opening a recordset, setting the field values, and updating.
I was wondering if anybody follows a standard on how to access/manipulate database info.
I'd like to find a way where I don't have to do any major string replacing/formatting to capture user input.
For example: a Last Name field may contain "O'Hare"
If I write a SQL statment there would be a problem because of the ' mark in the name.
Code:
sSQL = "UPDATE Table SET strLast = '" & Request.Form("strLast") & "' Where critera..."
Wheras if I used a recordset:
Code:
sSQL = "SELECT * From Table Where [some criteria...]"
myRS.open
myRS("strLast") = Request.Form("strLast")
etc...
Earnie Eng