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 change the location of Listbox using code
Count Worksheet Tabs on Excel File
error with web site when it was moved from server 2003 to 2008
Access 2000 Runtime
Open a web page from access 2003
Pass through query with declare doesn't return records
Retrieving info from DropDownList on OnSelectedIndexChanged in a repeater
PACK TABLE
Import .csv file into Access
VBA Function with Array Parameter not working