Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread StartTransaction problem after upgrade
Sat, Jul 7 2012 2:46 PMPermanent Link

Michael Fullerton

After upgrading from 2.04 UNI to 2.08 UNI the following line no longer
compiles:

     DB.StartTransaction(VarArrayOf(['Estimate','Expenses']));

giving this error:

There is no overloaded version of 'StartTransaction' that can be
called with these arguments

but this has line no problem:

   DB.StartTransaction(EmptyEDBStringsArray);

The update notes don't seem to indicate any change in this respect.
Any ideas?
Sun, Jul 8 2012 6:27 AMPermanent Link

Franco Fustini

Michael Fullerton wrote:

After upgrading from 2.04 UNI to 2.08 UNI the following line no longer
compiles:

     DB.StartTransaction(VarArrayOf(['Estimate','Expenses']));

giving this error:

There is no overloaded version of 'StartTransaction' that can be
called with these arguments

but this has line no problem:

   DB.StartTransaction(EmptyEDBStringsArray);

The update notes don't seem to indicate any change in this respect.
Any ideas?

Michael,

I think that the issue is as follows:

- You use a Variant Array instead of a TEDBStringsArray (Unit edbtype), which in UNI is a synonym of WideString type (see TEDBStringsArray help)

- DB.StartTransaction(EmptyEDBStringsArray); works because EmptyEDB.. is a pre-declared empty array of type TEDBStringsArray (see StartTransaction help)

-The error message says that there is not a version of this method accepting a variant array.

- You need to:
 -add edbtype to uses clause.
 -declare a "someTables" array of type TEDBStringsArray
 -Resize it as needed
 -Assign the needed tables to its elements
 -Use array someTables as first parameter of StartTransaction method

I think it should work.
Sun, Jul 8 2012 11:58 AMPermanent Link

Michael Fullerton

On Sun, 8 Jul 2012 06:27:17 -0400, Franco Fustini wrote:

>Michael Fullerton wrote:
>
>After upgrading from 2.04 UNI to 2.08 UNI the following line no longer
>compiles:
>
>      DB.StartTransaction(VarArrayOf(['Estimate','Expenses']));
>
>giving this error:
>
>There is no overloaded version of 'StartTransaction' that can be
>called with these arguments
>
>but this has line no problem:
>
>    DB.StartTransaction(EmptyEDBStringsArray);
>
>The update notes don't seem to indicate any change in this respect.
>Any ideas?
>
>Michael,
>
>I think that the issue is as follows:
>
>- You use a Variant Array instead of a TEDBStringsArray (Unit edbtype), which in UNI is a synonym of WideString type (see TEDBStringsArray help)
>
>- DB.StartTransaction(EmptyEDBStringsArray); works because EmptyEDB.. is a pre-declared empty array of type TEDBStringsArray (see StartTransaction help)
>
>-The error message says that there is not a version of this method accepting a variant array.
>
>- You need to:
>  -add edbtype to uses clause.
>  -declare a "someTables" array of type TEDBStringsArray
>  -Resize it as needed
>  -Assign the needed tables to its elements
>  -Use array someTables as first parameter of StartTransaction method
>
>I think it should work.

Yes that does work. Thanks Franco. The section "Restricted
Transactions" in the manual explains this method it in detail.
Thu, Aug 2 2012 3:49 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< After upgrading from 2.04 UNI to 2.08 UNI the following line no longer
compiles:

    DB.StartTransaction(VarArrayOf(['Estimate','Expenses'])); >>

Use this instead:

    DB.StartTransaction(['Estimate','Expenses']);

EDB now supports using constant arrays in Delphi/C++Builder for this method.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Aug 13 2012 8:19 PMPermanent Link

Dominique Willems

Tim Young [Elevate Software] wrote:
> Use this instead:
>
>     DB.StartTransaction(['Estimate','Expenses']);

This gives me a [DCC Error] MessagesDM.pas(1121): E2010 Incompatible
types: 'TEDBStringsArray' and 'array[0..1] of string'
Wed, Sep 5 2012 8:46 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Dom,

<< This gives me a [DCC Error] MessagesDM.pas(1121): E2010 Incompatible
types: 'TEDBStringsArray' and 'array[0..1] of string' >>

What version of Delphi are you using ?

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Sep 17 2012 5:39 AMPermanent Link

Dominique Willems

Tim Young [Elevate Software] wrote:
> Dom,
>
> << This gives me a [DCC Error] MessagesDM.pas(1121): E2010
> Incompatible types: 'TEDBStringsArray' and 'array[0..1] of string' >>
>
> What version of Delphi are you using ?

XE2 Update 4 last Hotfix.
Mon, Sep 17 2012 2:52 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Dom,

<< XE2 Update 4 last Hotfix. >>

It's the Unicode.  For some reason, the compiler won't match an array of
Unicode strings parameter with an 'array of const' parameter when binding to
the overloaded methods, so for now you're stuck with using the
TEDBStringsArray version.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Image