Microsoft
Software
Hardware
Network
Question : How to write SQL with string containing an apostrophe
This statment works fine until the 'SelectedCompany' contains an apostrophe
SQLstatement = "SELECT * " _
& "FROM tbContactsNonClients " _
& "WHERE Company = '" & SelectedCompany & "';"
How do I accomodate a string with an apostrophe since I'm using the 'single quotes' to avoid conflict among the "double quotes"?
Answer : How to write SQL with string containing an apostrophe
you can do this
SQLstatement = "SELECT * " _
& "FROM tbContactsNonClients " _
& "WHERE Company = " & chr(34) & SelectedCompany & chr(34)
Random Solutions
How to disable the Open File - Security Warning on Windows 7
Microsoft Vista SystemPropertiesComputerNa<wbr />me at Logon?
somethine or a user is running sql profiler on my sql server 2008 instance - how can i identify the session
SQL Server 2005 Windows 7 64bit
Reporting Services Error
Wsus WIndows 2003
Detect Open Form
Excel 2003 Advanced Properties hidden
Word 2007 Freezes When Printing
how to format 3 decimal places in spreadsheet control cells