Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Dataset Table name?
Sun, Jun 3 2018 2:30 AMPermanent Link

Ian Branch

Avatar

Hi Team,
Using the standard...
"procedure TMainForm.ttTTableEditError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction);"

Wanting to make this procedure a little more generic and a little more informative to the user, so it can be called from different TTables.
Is there some way I can retrieve the TableName of the calling Table?  
There doesn't seem to be any property of DataSet I can use.

Regards & TIA,
Ian
Sun, Jun 3 2018 4:57 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


Have you tried just casting it

TEDBTable(Dataset).TableName

it should work but without figuring out a way to cause an editing error I can't test properly. It did work just using a button click.

The only downside is you do need to be pretty sure its a TEDBTable first so you might want to add in

if Dataset is TEDBTable then ...

Roy Lambert
Sun, Jun 3 2018 4:58 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


Just a quick ps - the reason there's no tablename property is that it could be a query or something else.

Roy Lambert
Sun, Jun 3 2018 10:12 PMPermanent Link

Ian Branch

Avatar

Cheers Roy.  
All good.  No, TEDBQuery doesn't have a TableName.
Regards,
Ian
Image