xsharp.eu • Corruption detected on an index ... but NOT if index created within XSharp
Page 1 of 3

Corruption detected on an index ... but NOT if index created within XSharp

Posted: Sun Nov 26, 2023 6:55 pm
by RolWil
Hi All,

I’m Converting from harbour Clipper to XSharp, Harbor dialect and am doing so in Visual Studio.
I wish I could tell you what version of XSharp I’m using, but don’t know how to tell, despite searching with Google and this forum … perhaps someone could enlighten me please 😊

In my application is a function that performs calculations on about 10,000 people.

When I run the converted process with an active index created using the old Harbour version, after about 1400 records, I get the pop-up error widow you see an image of below.

However, if I create the index within the XSharp Windows version, the process completes calculations on all 10,000 records without error.

The Error occurs on a “file->dbskip()” statement inside a loop.

In the VS Output tab/pane, I get:

Exception thrown: 'XSharp.Internal.WrappedException' in XSharp.RT.dll
Exception thrown: 'XSharp.Error' in XSharp.RT.dll

The error pop-up (image below) indicates there was ‘corruption’ and ‘key not found’.

This is the key, it’s pretty straight forward:

BFMB->FC_MBCLIE+BFMB->FC_MBDIVI+BFMB->FC_MBGROU+BFMB->FC_MBIDEN

As always, thanks for your help.

The error pop up:

Re: Corruption detected on an index ... but NOT if index created within XSharp

Posted: Sun Nov 26, 2023 8:04 pm
by robert
Roland,
The easiest way to see the version of X# is to look at the Help-About screen in VS , and scroll to the bottom until you see the X# project system listed.

W.r.t. the index corruption:
Most likely this is related to what is called "the collation", the sort table for indices.
You need to show us the settings for your Harbour app and the link script.
In X# you can set everything in code, and we need to make sure that the settings on both sides are equal.

Robert

Re: Corruption detected on an index ... but NOT if index created within XSharp

Posted: Mon Nov 27, 2023 4:14 am
by RolWil
Hi Robert, many thanks for your answers.

I’m currently running XSharp 2.14.04

I’m attaching images of my settings but don’t know where to find a ‘link script’ and can’t find related any information; perhaps you could tell me where to find it.

Regards,
Roland


NOTE: I cannot add images, my attempts simply fail - no error. I've tried using 'attachments' and drag/drop, neither work for me. I can't even delete this post. I'll try tomorrow again.

Re: Corruption detected on an index ... but NOT if index created within XSharp

Posted: Mon Nov 27, 2023 8:07 am
by Chris
Hi Roland,

Please select "Attachments" below the email text and press the button "Add files", this should allow you to select the files from disk directly. Does that work?

Re: Corruption detected on an index ... but NOT if index created within XSharp

Posted: Mon Nov 27, 2023 1:14 pm
by RolWil
Hi Chris,

that's what I did first and it worked once, but I needed to add another image. After I tried that and attempted a 'preview' there were no images, not even the original one and from then on, I couldn't add any.

My next step is to start with a new post.

Roland

Re: Corruption detected on an index ... but NOT if index created within XSharp

Posted: Mon Nov 27, 2023 1:17 pm
by RolWil
Second attempt at replying with attached image.


Hi Robert, many thanks for your answers.

I’m currently running XSharp 2.14.04

I’m attaching images of my settings but don’t know where to find a ‘link script’ and can’t find related any information; perhaps you could tell me where to find it.

Regards,
Roland

Re: Corruption detected on an index ... but NOT if index created within XSharp

Posted: Mon Nov 27, 2023 3:28 pm
by RolWil
OK, I added:

SetCollation("Clipper")

to the top of my initialization code and the error still occurs.

I should mention that I'm using the DBFNTX RDD.

Re: Corruption detected on an index ... but NOT if index created within XSharp

Posted: Mon Nov 27, 2023 3:46 pm
by wriedmann
Hi Roland,
if you are using SetCollation( #Clipper ) you need also to specify which language with SetNatDll(). This setting has to reflect what you are using in your other application.
Wolfgang

Re: Corruption detected on an index ... but NOT if index created within XSharp

Posted: Mon Nov 27, 2023 4:07 pm
by robert
With the link script ( maybe not the right we orde) I meant the libraries and files that you referring to in your harbour program.

Robert

Re: Corruption detected on an index ... but NOT if index created within XSharp

Posted: Mon Nov 27, 2023 4:15 pm
by RolWil
Hi Wolfgang and thank you.

Here's what I now have ... but still get the error:

SetAnsi(.t.)
SetCollation("Clipper")
SetNatDLL("ENGLISH")
RDDSetDefault("DBFNTX")