Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 13 total
Thread Where comes this error from?
Mon, Oct 20 2008 3:14 PMPermanent Link

"KHJ"
I am converting my first database from DBISAM to EDB (Unicode) in D2009.
Now I get the following failure and can't find the reason for it.

The database is Unicode and my strings are "string" from D2009
(Unicode)

First chance exception at $7C812AEB. Exception class EDatabaseError
with message 'TableUser: Type mismatch for field 'Username', expecting:
String actual: WideString'. Process SKraft2009.exe (5560)

Some idea.

Regards

Karlheinz
Mon, Oct 20 2008 5:06 PMPermanent Link

"KHJ"
KHJ wrote:

> I am converting my first database from DBISAM to EDB (Unicode) in
> D2009.  Now I get the following failure and can't find the reason for
> it.
>
> The database is Unicode and my strings are "string" from D2009
> (Unicode)
>
> First chance exception at $7C812AEB. Exception class EDatabaseError
> with message 'TableUser: Type mismatch for field 'Username',
> expecting:  String actual: WideString'. Process SKraft2009.exe (5560)
>

Problem happens behind

procedure TEDBDataSet.InternalOpen;
in Line =>       BindFields(True);

I can't follow here because I can't set a breakpoint in unit DB.

Hopefully you know what is wrong or where I have to look.

Regards
Karlheinz
Mon, Oct 20 2008 10:20 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Karl,

<< I am converting my first database from DBISAM to EDB (Unicode) in D2009.
Now I get the following failure and can't find the reason for it.

The database is Unicode and my strings are "string" from D2009 (Unicode)

First chance exception at $7C812AEB. Exception class EDatabaseError with
message 'TableUser: Type mismatch for field 'Username', expecting: String
actual: WideString'. Process SKraft2009.exe (5560) >>

Are you actually compiling with the Unicode version of EDB ?  It sounds like
the EDB code is setting the field types to ftString instead of ftWideString,
which is what will happen for the non-Unicode version of EDB.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Oct 21 2008 12:05 PMPermanent Link

"KHJ"
Tim Young [Elevate Software] wrote:

> Are you actually compiling with the Unicode version of EDB ?  It
> sounds like the EDB code is setting the field types to ftString
> instead of ftWideString, which is what will happen for the
> non-Unicode version of EDB.


No, I checked it once more. I have only one version (Unicode) installed
at checked the source file folder: TEDBString = Unicode.

Do you have an other idea?

I saw for 2.02 build 1 the issue with the locate procedure. Could it be
the same problem?

Regards Karlheinz
Tue, Oct 21 2008 1:25 PMPermanent Link

"KHJ"
Tue, Oct 21 2008 3:00 PMPermanent Link

"KHJ"
KHJ wrote:

> Tim Young [Elevate Software] wrote:
>
> > Are you actually compiling with the Unicode version of EDB ?  It
> > sounds like the EDB code is setting the field types to ftString
> > instead of ftWideString, which is what will happen for the
> > non-Unicode version of EDB.
>
>
> No, I checked it once more. I have only one version (Unicode)
> installed at checked the source file folder: TEDBString = Unicode.
>
> Do you have an other idea?

Tim,

I could find the following:

procedure TEDBDataSet.OpenCursor(InfoQuery: Boolean);
begin
=> unitl here I get with the watchlist for fielddefs => ftstring
  FHandle:=CreateHandle;
=> and here I get as result ftWidestring
  if (FHandle=nil) then
     DatabaseError(SHandleError);
  inherited OpenCursor(InfoQuery);
end;

=> and if I track it more down

procedure TEDBDataSet.InternalInitFieldDefs;
var
  I: Integer;
begin
  FieldDefs.Clear;
=> it happens in the for loop that ftstring changes in ftwidestring
  for I:=0 to FHandle.CursorColumns.Count-1 do
     AddColumnFieldDef(I,FHandle.CursorColumns[I]);
end;

I hope this will help you

Karlheinz
Tue, Oct 21 2008 3:25 PMPermanent Link

"KHJ"
KHJ wrote:

> => and if I track it more down
>
> procedure TEDBDataSet.InternalInitFieldDefs;
> var
>    I: Integer;
> begin
>    FieldDefs.Clear;
> => it happens in the for loop that ftstring changes in ftwidestring
>    for I:=0 to FHandle.CursorColumns.Count-1 do
>       AddColumnFieldDef(I,FHandle.CursorColumns[I]);
> end;

some steps more

I found that DataTypeMap includes ftWideString and not ftString.
I changed for test ftWidestring into ftstring and it works.

I hope it was the problem please verify.

Karlheinz
Tue, Oct 21 2008 5:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Karl,

<< No, I checked it once more. I have only one version (Unicode) installed
at checked the source file folder: TEDBString = Unicode. >>

Are you compiling with the source code ?  If so, then you need to make sure
to include this conditional directive in your application's project options:

EDB_UNICODE

<< I saw for 2.02 build 1 the issue with the locate procedure. Could it be
the same problem? >>

No, it's a completely different issue.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Oct 21 2008 5:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Karl,

That screen shot indicates that you're not using the Unicode version, or
previously were not using the Unicode version when you created those
persistent fields.  Any persistent string fields should be created as
ftWideString, not ftString.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Oct 21 2008 5:58 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Karl,

<< => and here I get as result ftWidestring >>

ftWideString is correct, it should not be ftString, which is an AnsiString
under D2009.

--
Tim Young
Elevate Software
www.elevatesoft.com

Page 1 of 2Next Page »
Jump to Page:  1 2
Image