Page 1 of 2

TUniLoader invalid column number

Posted: Fri 13 Dec 2013 09:15
by sandy771
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;
}

Re: TUniLoader invalid column number

Posted: Fri 13 Dec 2013 12:59
by AlexP
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

Re: TUniLoader invalid column number

Posted: Fri 13 Dec 2013 13:01
by sandy771
Alex

I am using Builder XE5 unidac51d17 with sqlite.

Do you have an example creating and using TUniLoader programatically?

Re: TUniLoader invalid column number

Posted: Fri 13 Dec 2013 14:47
by sandy771
Thanks alex - demo program sent

Re: TUniLoader invalid column number

Posted: Fri 13 Dec 2013 15:02
by AlexP
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();
}

Re: TUniLoader invalid column number

Posted: Tue 17 Dec 2013 15:38
by sandy771
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.

Re: TUniLoader invalid column number

Posted: Wed 18 Dec 2013 09:06
by AlexP
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.

Re: TUniLoader invalid column number

Posted: Wed 18 Dec 2013 10:03
by sandy771
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

Re: TUniLoader invalid column number

Posted: Wed 18 Dec 2013 10:45
by AlexP
Hello,

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

Re: TUniLoader invalid column number

Posted: Mon 23 Dec 2013 20:57
by sandy771
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

Re: TUniLoader invalid column number

Posted: Tue 24 Dec 2013 16:36
by sandy771
I'll take that as a no then

Re: TUniLoader invalid column number

Posted: Thu 26 Dec 2013 09:49
by AlexP
Hello,

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

Re: TUniLoader invalid column number

Posted: Thu 26 Dec 2013 10:30
by sandy771
Thanks - downloading
Merry Christmas

Re: TUniLoader invalid column number

Posted: Sat 28 Dec 2013 17:11
by sandy771
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?

Re: TUniLoader invalid column number

Posted: Mon 30 Dec 2013 12:58
by AlexP
Hello,

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