String constants must end with a double quote


I have some MS Access Queries built and instead of having UiPath automate the opening of said database and using activities to automate the running of these queries I’m trying to leverage the UiPath.Database.Activities package to connect to the database and run queries.

After using the Connect activity within the package I’m using the execute activity. Within MS Access you can view the SQL text of the queries that are built and I’m basically trying to use that script and paste it into the SQL portion of the Execute activity. Some of them work without issues, however, I’m having an issue with double quotes on some of my queries.

Here’s the script directly from MS Access that I’m trying to throw into the execute activity:

INSERT INTO [C&A Combined] ( PostDate, ServDate, Loc, Account, Name, [Proc Code], WOPC, FC, Payor, Plan, Amount, Code, Census, [Client Class], Batch )
SELECT [C&A]![Post Mth] & “/” & [C&A]!PostDay & “/” & [C&A]![Post Yr] AS PostDate, [C&A]![Serv Mth] & “/” & [C&A]!ServDay & “/” & [C&A]![Serv Yr] AS ServDate, [C&A].Loc, [C&A].Account, [C&A].Name, [C&A].[Proc Code], [C&A].WOPC, [C&A].[FC #2], [C&A].[Payor #2], [C&A].[Plan #2], Sum([C&A].[Amt #2]) AS [SumOfAmt #2], [C&A].Code, [C&A].Census, [C&A].ClientClass, [C&A].Batch
GROUP BY [C&A]![Post Mth] & “/” & [C&A]!PostDay & “/” & [C&A]![Post Yr], [C&A]![Serv Mth] & “/” & [C&A]!ServDay & “/” & [C&A]![Serv Yr], [C&A].Loc, [C&A].Account, [C&A].Name, [C&A].[Proc Code], [C&A].WOPC, [C&A].[FC #2], [C&A].[Payor #2], [C&A].[Plan #2], [C&A].Code, [C&A].Census, [C&A].ClientClass, [C&A].Batch
HAVING (((Sum([C&A].[Amt #2]))<>0));

I’ve placed quotes at the beginning and end of this and also doubled the quotes around the “/” portion to make it “”“/”“”, however, I’m still getting the error of, “String constants must end with a double quote”.

I cannot figure out where I’m needing these placed. Can anyone help, please?

1 Like

Hi @mss68291

Try this. Chr(34) + “what ever texts” + Chr(34)

I also have the problem (I am trying to quickly produce an xml file) and this has not worked for me, has anyone got any other suggestions?