I'm having trouble Updating a field when there's an apostrophe (single quote) in the field. The same code put directly into Access works fine so it has to do with the interface.
put "Update Campers Set LastName='" & fld LastName & "' where ID=" & fld WID & ";" into uQuery
put revdb_execute(tConnectionID,uQuery) into dummy
Of course, there would be a problem with unmatched quotes in the above if the Name was O'Boyle.
I've taken out the single quotes in the code and replaced with & quote.
the value in uquery wouls be
Update Campers Set LastName="O'Boyle" where ID=365;
This code would work directly in Access but returns an error of
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Any thoughts?
Gimp
Updating in Access- quotes
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Dear Gimp,
I'm not an experienced Access user, but don't you have to escape the additional quote in O'Neil? Are you sure Access understands if you exchange all apastrophes and double quotes?
Try
Update Campers Set LastName='O\'Boyle' where ID=365;
(I believe it is a backslash, it might be a slash).
Mark
I'm not an experienced Access user, but don't you have to escape the additional quote in O'Neil? Are you sure Access understands if you exchange all apastrophes and double quotes?
Try
Update Campers Set LastName='O\'Boyle' where ID=365;
(I believe it is a backslash, it might be a slash).
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Thanks but "O'Neil" works within access but not within revolution. I tried the escaping with a slash but it didn't help.Mark wrote:Dear Gimp,
I'm not an experienced Access user, but don't you have to escape the additional quote in O'Neil? Are you sure Access understands if you exchange all apastrophes and double quotes?
Try
Update Campers Set LastName='O\'Boyle' where ID=365;
(I believe it is a backslash, it might be a slash).
Mark
I think I found the solution. I just found out that two consecutive single quotes is treated by Access as one single quote. Therefore, by replacing any quotes in a field with pairs of quotes will allow the proper passing of the string query parameter and the final value seen in Access has only one quote.
And thanks, because your suggestion led me to the answer.
And thanks, because your suggestion led me to the answer.