Avatar of peter57r
peter57r
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Crystal Reports - updating database via SQL statement

This relates to the question here:
https://www.experts-exchange.com/questions/27380729/Getting-the-following-error-when-inserting-a-line-to-database-from-crystal-reports.html

Can someone explain the technicals of this approach.
Where is the sql statement going in the report?  Are there specific scenarios where this does or doesn't work?

I had previously believed that the drivers used in CR were specifically  read only on the selected tables. So this is a new thing for me.
Crystal Reports

Avatar of undefined
Last Comment
James0628

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
GJParker

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
peter57r

ASKER
Very interesting .

It has set me thinking as to why I thought what I thought and I'm fairly sure it was based on 'authoritative' comments in a particular CR specialist site.  There is an extremely remote  ((:-)) possibility that I have misinterpreted such comments and I might have a search to see if I can find it again, although it will be quite a long time ago that I saw it.

So the situation is that if I can write the code in SQL Server Management Studio I should be able to run it in a CR 'Add Command' box - provided it returns something.  
GJParker

Yes as I understand it that is correct, the only difficult comes when you want to include paramter values in the command as some DB's / connections require you to add the single quotes for string parameters and some will add handle the SQL without them.

SOLUTION
James0628

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
peter57r

ASKER
I haven't found the document that sent me off this way, but I can now recall that the situation was a bit different to this in that there was a potential requirement to update the database based on the results calculated in the report.  Clearly that is not what we are talking about here and unfortunately I have, over time,  mistakenly generalised that experience to a 'no updates' position.
I have never had anyone else ask me for a database update feature with a report so I've never had to review my thinking.

Very useful lesson learnt.

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
James0628

Yeah, that would be a different situation.  Funny how things gets stuck in your head a certain way sometimes (well, my head anyways :-).

 James