[dba-SQLServer]Changing apostrophes in string

David Emerson davide at dalyn.co.nz
Sun Feb 16 21:12:46 CST 2003


I tried the archives but couldn't get in .

I have a simple sql statement to be run from and AXP ADP to SQL2000

DoCmd.RunSQL "UPDATE tblCustStatement SET tblCustStatement.SMName = '" &
[Forms]![frmCustomers]![MName] & "' WHERE (((tblCustStatement.CustIDNo)=
" & [Forms]![frmCustomers]![txtCustomerID] & ") AND 
((tblCustStatement.StatementNumber)= " &
[Forms]![frmCustomers]![txtInvNumber] & "));"

How do we handle the following situation where [Forms]![frmCustomers]!MName 
includes an apostrophe?


Regards

David Emerson
DALYN Software Ltd
25b Cunliffe St, Johnsonville
Wellington, New Zealand
Ph/Fax (877) 456-1205 




More information about the dba-SQLServer mailing list