TUniLoader invalid column number

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

TUniLoader invalid column number

Post by sandy771 » Fri 13 Dec 2013 09:15

Within UniLoaderPutData I am calling PutColumnData using the column name.

I have verified that the column is in the uniloader columns property

but I get an error, "invalid column number"

Any ideas?


Further info, loader is created programatically


Tab = new TUniTable(uni);
Tab->Connection = uni;

loader = new TUniLoader(Tab);
loader->Connection = uni;
loader->OnPutData = UniLoaderPutData;
LoaderRecNo = 0;


Data is in a couple of call variable

LoaderField = f;
LoaderValue = s;
loader->OnPutData(loader);

Sender->PutColumnData(LoaderField, LoaderRecNo, LoaderValue); // **** error occurs here



LoaderRecNo is incremented for each row and reset when data written to table
LoaderRecNo++;
if(LoaderRecNo > 10)
{
loader->Load();
LoaderRecNo = 0;
}

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniLoader invalid column number

Post by AlexP » Fri 13 Dec 2013 12:59

Hello,

We cannot reproduce the problem. Please clarify the versions of the IDE and UniDAC. In addition, specify the name of the DB you are working with, and send the table creating script and the full sample reproducing the problem to alexp*devart*com

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: TUniLoader invalid column number

Post by sandy771 » Fri 13 Dec 2013 13:01

Alex

I am using Builder XE5 unidac51d17 with sqlite.

Do you have an example creating and using TUniLoader programatically?

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: TUniLoader invalid column number

Post by sandy771 » Fri 13 Dec 2013 14:47

Thanks alex - demo program sent

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniLoader invalid column number

Post by AlexP » Fri 13 Dec 2013 15:02

Hello,

To use UniLoader, you should use the following code:

Code: Select all

class TMyClass : public TObject
{
private:		// User declarations
	TUniConnection *UniConnection;
	TUniLoader *UniLoader;
	int LoaderRecNo;
	void __fastcall PutData(TDALoader *Sender);
public:		// User declarations
	__fastcall TMyClass();

};

void __fastcall TMyClass::PutData(TDALoader *Sender)
{
	for (int i = 0; i < LoaderRecNo ; i++) {
		Sender->PutColumnData("f1", i, "data");
		Sender->PutColumnData("f2", i, "data");
	}
}

__fastcall TMyClass::TMyClass(): TObject()
{
	UniConnection = new TUniConnection(NULL);
	UniConnection->ConnectString = "ProviderName=SQLite;Database=:memory:";
	UniConnection->ExecSQL("create table table1 (f1 text, f2 text)");
	UniLoader = new TUniLoader(NULL);
	UniLoader->Connection = UniConnection;
	UniLoader->TableName = "table1";
	UniLoader->OnPutData = PutData;
	UniLoader->Load();
}

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: TUniLoader invalid column number

Post by sandy771 » Tue 17 Dec 2013 15:38

I have been told by devart that this is a bug and will be fixed in the next release. I have asked (twice) if there is a work around and when the next release is but have had no answer.

I guess this is as good a reason as any to try firedac.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniLoader invalid column number

Post by AlexP » Wed 18 Dec 2013 09:06

Hello,

Unfortunately, we haven't received any letters from you..

For the time being, there is no workaround for the problem. The new version including this fix will be released within a week.

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: TUniLoader invalid column number

Post by sandy771 » Wed 18 Dec 2013 10:03

Alex I sent two emails to alexp [@] devart.com (I replied to your email informing me of the bug) one on 16/12 at 11:49 (UK time) and again on 17/12 at 10:09

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniLoader invalid column number

Post by AlexP » Wed 18 Dec 2013 10:45

Hello,

Unfortunately, we haven't received your mail, it might be blocked by our spam-filter.

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: TUniLoader invalid column number

Post by sandy771 » Mon 23 Dec 2013 20:57

AlexP wrote: For the time being, there is no workaround for the problem. The new version including this fix will be released within a week.
Hi - will this be released this side of Christmas? if not when?

Cheers

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: TUniLoader invalid column number

Post by sandy771 » Tue 24 Dec 2013 16:36

I'll take that as a no then

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniLoader invalid column number

Post by AlexP » Thu 26 Dec 2013 09:49

Hello,

The new UniDAC version is already available at our website for download now

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: TUniLoader invalid column number

Post by sandy771 » Thu 26 Dec 2013 10:30

Thanks - downloading
Merry Christmas

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: TUniLoader invalid column number

Post by sandy771 » Sat 28 Dec 2013 17:11

When I compile under Builder XE5 update 2 with the new version (5.2.5) I get the following error messages

[ilink32 Error] Error: Unresolved external 'memcmp' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\LITEPROVIDER190.LIB|LiteStaticUni

[ilink32 Error] Error: Unresolved external 'memmove' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\LITEPROVIDER190.LIB|LiteStaticUni

Any ideas?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniLoader invalid column number

Post by AlexP » Mon 30 Dec 2013 12:58

Hello,

Thank you for the information, we have reproduced the problem and will try to fix it in the nearest future.

Post Reply