Crashing table

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Crashing table

Post by oz8hp » Fri 19 Feb 2010 13:46

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?

tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

Post by tobias_cd » Fri 19 Feb 2010 13:57

I think you should use this instead:

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

oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Post by oz8hp » Sat 20 Feb 2010 11:08

Table still crashing

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

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 22 Feb 2010 08:14

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.

oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Post by oz8hp » Mon 22 Feb 2010 10:07

To make things even more strange it works OK on MS SQL

I will see if I can make a small sample

oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Post by oz8hp » Tue 23 Feb 2010 05:57

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.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 23 Feb 2010 14:29

Was the problem solved? If any other questions come up, please contact me.

oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Post by oz8hp » Tue 23 Feb 2010 17:43

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)

Post Reply