IBCArray in C++

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
barnie00
Posts: 11
Joined: Mon 24 Sep 2007 20:37

IBCArray in C++

Post by barnie00 » Mon 04 Jan 2010 00:09

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?

barnie00
Posts: 11
Joined: Mon 24 Sep 2007 20:37

Post by barnie00 » Tue 05 Jan 2010 23:38

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?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 15 Jan 2010 09:16

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();

Post Reply