Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Brain Fog with MyDac and XE7

Status
Not open for further replies.

Baldur3635

Technical User
Feb 15, 2010
26
BE
I was a regular Delphi programmer years ago, when I was working. I'm now retired and 80 years old. A pal of mine that I did a lot of work for in the past, asked me to write a simple program for him. On a pension, I can use the money.

He's got XE7. All it involves is writing some values to a MySQL database. Dead simple stuff. He's got MyDac that I've used before and I knocked up everything he wanted in a couple of hours.

I'm using a simple My Query to write the info to the database. It works fine BUT . . .

There's always the snag. One of the fields is a Primary Key. Whilst it should never happen. It did.

I know from the Past that MyDac has its own error handling. I've looked all over, the documentation is parse, but this is eluding me. 80 year brain fog.

Can anyone help?
 
What's the part that you're needing help with? In general you don't change primary key fields but, instead, write the new record with the new primary key and, if successful, delete the old record. You might have to add a small bit of logic to handle that case.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top