robsuttonjr
MIS
I am using SQLEXEC to INSERT data into tables on a MS SQL 7 server. I am trying to figure out how to handle when a user enters special characters that will kick back an error. For example:
gcVendorName = "Rob's Stuff"
SQLEXEC(gnHandle, "EXEC sp_Insert_Customer '" +gcVendorName+ "'"
In the above example the gcVendorName has a single quote stored in it. Because of this it throws off sql server and kicks back an error. Is the solution to only allow alphanumeric data? How can I set the fields to only allow alphanumeric data? Is there a better way? Thanks!
gcVendorName = "Rob's Stuff"
SQLEXEC(gnHandle, "EXEC sp_Insert_Customer '" +gcVendorName+ "'"
In the above example the gcVendorName has a single quote stored in it. Because of this it throws off sql server and kicks back an error. Is the solution to only allow alphanumeric data? How can I set the fields to only allow alphanumeric data? Is there a better way? Thanks!