Guest_imported
New member
- Jan 1, 1970
- 0
Thanks for the help with my apostrophe problem, folks, but could you explain more in detail as I am a beginner please.
The relevant code is below. What exactly do I do to it to sort out this apostrophe problem?
(The problem is that I can't insert a record with an apostrophe in it without an error message coming up or everything after the apostrophe being deleted).
Many thanks
James
set conn = server.createobject("adodb.connection"
conn.open "property"
SQLstmt = "INSERT INTO details (road,area,postcode,weekly_rental,number_bedrooms,location,furnished,list_text,detail_text,imageone,imagetwo)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & road & "',"
SQLstmt = SQLstmt & "'" & area & "',"
SQLstmt = SQLstmt & "'" & postcode & "',"
SQLstmt = SQLstmt & "'" & weekly_rental & "',"
SQLstmt = SQLstmt & "'" & number_bedrooms & "',"
SQLstmt = SQLstmt & "'" & location & "',"
SQLstmt = SQLstmt & "'" & furnished & "',"
SQLstmt = SQLstmt & "'" & list_text & "',"
SQLstmt = SQLstmt & "'" & detail_text & "',"
SQLstmt = SQLstmt & "'" & imageone & "',"
SQLstmt = SQLstmt & "'" & imagetwo & "'"
SQLstmt = SQLstmt & "
"
Set RS = conn.execute(SQLstmt)
If err.number>0 then
response.write "VBScript Errors Occured:" & "<P>"
response.write "Error Number=" & err.number & "<P>"
response.write "Error Descr.=" & err.description & "<P>"
response.write "Help Context=" & err.helpcontext & "<P>"
response.write "Help Path=" & err.helppath & "<P>"
response.write "Native Error=" & err.nativeerror & "<P>"
response.write "Source=" & err.source & "<P>"
response.write "SQLState=" & err.sqlstate & "<P>"
end if
The relevant code is below. What exactly do I do to it to sort out this apostrophe problem?
(The problem is that I can't insert a record with an apostrophe in it without an error message coming up or everything after the apostrophe being deleted).
Many thanks
James
set conn = server.createobject("adodb.connection"
conn.open "property"
SQLstmt = "INSERT INTO details (road,area,postcode,weekly_rental,number_bedrooms,location,furnished,list_text,detail_text,imageone,imagetwo)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & road & "',"
SQLstmt = SQLstmt & "'" & area & "',"
SQLstmt = SQLstmt & "'" & postcode & "',"
SQLstmt = SQLstmt & "'" & weekly_rental & "',"
SQLstmt = SQLstmt & "'" & number_bedrooms & "',"
SQLstmt = SQLstmt & "'" & location & "',"
SQLstmt = SQLstmt & "'" & furnished & "',"
SQLstmt = SQLstmt & "'" & list_text & "',"
SQLstmt = SQLstmt & "'" & detail_text & "',"
SQLstmt = SQLstmt & "'" & imageone & "',"
SQLstmt = SQLstmt & "'" & imagetwo & "'"
SQLstmt = SQLstmt & "
Set RS = conn.execute(SQLstmt)
If err.number>0 then
response.write "VBScript Errors Occured:" & "<P>"
response.write "Error Number=" & err.number & "<P>"
response.write "Error Descr.=" & err.description & "<P>"
response.write "Help Context=" & err.helpcontext & "<P>"
response.write "Help Path=" & err.helppath & "<P>"
response.write "Native Error=" & err.nativeerror & "<P>"
response.write "Source=" & err.source & "<P>"
response.write "SQLState=" & err.sqlstate & "<P>"
end if