Page 1 of 1

IBCArray in C++

Posted: Mon 04 Jan 2010 00:09
by barnie00
Hello!

I found the following delphi Code

Code: Select all

var
IBCArray : TIBCArray;

ibcqry1.sql := SELECT myarray from mytable where mykey=keyvalue
ibcqry1.options.CacheArrays := false;
ibcqry1.open;
IBCArray := ibcqry1.GetArray('myarray' );
IBCArray.cached:= false;
IBCArray.SetItemAsFloat([46],365.34);
ibcqry1.close; 
But I need a c++ Version.
When I try to get the array with "new" the result is the following error

E2285 Keine Übereinstimmung für 'TIBCArray::TIBCArray()' gefunden

Whats wrong?

Posted: Tue 05 Jan 2010 23:38
by barnie00
Sorry I forgot to translate the error message :

E2285 Could not find a match for...

I understand that that I have to translate the line

IBCArray : TIBCArray;

but I wasn't able to find the correct declaration in the IBCArray-Header.

Can somebody help?

Posted: Fri 15 Jan 2010 09:16
by Plash
Use the following code:

Code: Select all

	TIBCArray* IBCArray;

	ibcqry1->SQL->Text = "SELECT myarray from mytable where mykey=keyvalue";
	ibcqry1->Options->CacheArrays = false;
	ibcqry1->Open();
	IBCArray = ibcqry1->GetArray("myarray");
	IBCArray->Cached = false;
	int ind[] = {46};
	IBCArray->SetItemAsFloat(ind, sizeof(ind), 365.34);
	ibcqry1->Close();