Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting data from Access
I am having problems with apostrophes...
I'm in Excel, and using Excel VBA, I utilize an ADODB connection to get data out of Access The user enters a company name (eg, General Motors), and all the deals for General Motors are returned. The simplified line of SQL is: HAVING (((Deals.Company)="General Motors")); But in Excel VBA, the quotations are changed for apostrophes HAVING (((Deals.Company)='General Motors')); And I use a variable, rather than the company name [Earlier] myCompany= InputBox("What company?") [Later] HAVING (((Deals.Company)="'" & myParent & "'")); This works for 99% of my companies, but not for companies with an apostrophe in it. eg "Foster's Group". For this company, I get an error when I come to extract the data. Can anyone advise me how to handle this variation? Thanks Daniel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting data from Access
Can you post your entire SQL code. Seems like you should just replace
all the Foster's examples without the ' s. Stopher |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extracting data from Access - error encountered | Excel Programming | |||
Extracting from Access | Excel Programming | |||
Extracting Excel Formulas into Access | Excel Programming | |||
Extracting Excel data and uploading to access | Excel Programming | |||
Extracting Access data | Excel Programming |