Page 1 of 1

Crashing table

Posted: Fri 19 Feb 2010 13:46
by oz8hp
I have 2 tables on my MySQL server that has a field of type time
I have some code that loops one table and copies selected fields from selected records to a new table.

Every thing is working OK except for this line of code:

QueryOutput.ParamByName('fldTime').Assign(SourceInput.DataSet.FieldByName('fldTime'));

As soon as this is being activated, the result is that my output table is crashed.

I have another field of type date and simular code that runs OK


Any ideas?

Posted: Fri 19 Feb 2010 13:57
by tobias_cd
I think you should use this instead:

QueryOutput.ParamByName('fldTime').Value := SourceInput.DataSet.FieldByName('fldTime').Value;

Posted: Sat 20 Feb 2010 11:08
by oz8hp
Table still crashing

It is very strange why it is just the time field - the date field i transfer is doing OK

Posted: Mon 22 Feb 2010 08:14
by Dimon
I could not reproduce the problem.
Please send me a complete small sample to dmitryg*devart*com to demonstrate it, including a script to create and fill a table.

Posted: Mon 22 Feb 2010 10:07
by oz8hp
To make things even more strange it works OK on MS SQL

I will see if I can make a small sample

Posted: Tue 23 Feb 2010 05:57
by oz8hp
To get things running on MS SQL I had to remove the Query.Prepare that someone had put in the code. This also has effekt on MySQL because now it looks like things are running with the Time field :shock:
Very strange I think.

Posted: Tue 23 Feb 2010 14:29
by Dimon
Was the problem solved? If any other questions come up, please contact me.

Posted: Tue 23 Feb 2010 17:43
by oz8hp
It looks like removing the Query.Prepare from my input query solved the issue.
I don't know why it was there in the first place (not ny code)