xsharp.eu • ADS Connect 60 and RDD's
Page 1 of 2

ADS Connect 60 and RDD's

Posted: Fri Jul 17, 2020 12:52 pm
by John Roe
Hi

I'm having problems with a legacy app which uses Connect60 and OLEDB to access Advantage ADT tables.
The OLEDB calls are fine but the connect 60 is only recognising the first 10 characters of fieldnames.

I have created a a test app which uses the following:

lReturn := AdsConnect60("Z:HelpdeskDataHelpdesk.add", 0x0002 ,"ADSSYS" ,"whatever",0 , hConnect )
/* Set the connection handle */
AX_SetConnectionHandle( hConnect )
RddSetDefault("ADSADT")

oDBParamfil := DBServer{"Paramfil",DBSHARED}
oDBParamfil:GoTop()

// This works
nData := oDBParamfil:FIELDGET(#Batchno) // OK as Fieldname < 10 Chars

// This fails
nData := oDBParamfil:FIELDGET(#SupChkPeriod) // FAILS as Fieldname > 10 Chars

If the table has multiple fields where the first 10 chars are identical then the table doesn't open at all as the Fieldspec Object fails to initialise.

Its like the incorrect RDD is being used.

Thanks

John

ADS Connect 60 and RDD's

Posted: Fri Jul 17, 2020 1:29 pm
by wriedmann
Hi John,
are you using the X# RDD?
Wolfgang

ADS Connect 60 and RDD's

Posted: Fri Jul 17, 2020 1:36 pm
by John Roe
Hi Wolfgang
Thanks for the super quick response.
I'll check that out as this is the first attempt at importing from VO to XSharp and I'm sure there will be lots to learn.
Regards
John

ADS Connect 60 and RDD's

Posted: Fri Jul 17, 2020 1:40 pm
by wriedmann
Hi John,
I'm using ADS myself, but not with ADT data tables and no fieldnames longer than 10 characters.
Maybe Chris will step in and check in the sources.
Robert who wrote the X# RDD unfortunately is on a well deserved holiday.
Wolfgang
P.S. I have moved the thread to the right forum

ADS Connect 60 and RDD's

Posted: Fri Jul 17, 2020 1:59 pm
by John Roe
Hi Wolfgang

Thanks for your help - I'll eventually find my way around the forum.

I'm sure we'll make lots of silly mistakes at the outset and I don't want to cause anyone unnecessary problems. We're trying to get up to speed importing a small internal application so we can be ready to migrate a major product next year.

I must say I'm amazed at what a splendid job the Team have done on XSharp - and Robert certainly deserves a well earned break.

Best wishes and have a good weekend.

John

ADS Connect 60 and RDD's

Posted: Fri Jul 17, 2020 2:05 pm
by wriedmann
Hi John,
the open source approach has a very strong advantage: we can lookup in ervery moment at the X# sources on GitHub and that helps not only a lot to find errors (there are some forum members here that suggested changes based on the code they have seen on GitHub), but could also helps to build quick fixes when needed.
Wolfgang

ADS Connect 60 and RDD's

Posted: Fri Jul 17, 2020 2:24 pm
by John Roe
Thanks Wolfgang

I greatly look forward to taking an active part in the Developer community once again.

Things have come along way since the VO DevFest days and I have a lot of catching up to do.

Best wishes

John

ADS Connect 60 and RDD's

Posted: Fri Jul 17, 2020 2:40 pm
by wriedmann
Hi John,
you are very welcome here!
Wolfgang

ADS Connect 60 and RDD's

Posted: Fri Jul 17, 2020 3:04 pm
by Chris
Hi John,

I could be missing something, but I don't see something in the code that could be causing this. What happens if you use strings instead, as in oDBParamfil:FIELDGET("SUPCHKPERIOD"), does it make a difference?

If not, please check, does specifying the field index number instead work? Like oDBParamfil:FIELDGET(30). If it does, then please check the return value of FieldName(<field index>), what does this return? Is it the field name with only the first 10 chars?

ADS Connect 60 and RDD's

Posted: Mon Jul 20, 2020 11:53 am
by John Roe
Hi Chris

Thanks for your suggestions and if we refer to the fields by number then we do can see the correct data. Getting the FieldName with oDBParamfil:FieldName(2) does only return the first 10 characters of the fieldname. We have inspected the DBServer object and the long fieldnames are truncated to 10 chars.

We believe we are referencing the correct driver and have explicitly referenced XSharp.RDD as in:

lReturn := XSharp.RDD.Functions.AdsConnect60("Z:ADSFieldTestADSFieldTest.add", 0x0002 ,"ADSSYS" ,"",0 , hConnect )

We have put together a small Advantage Database plus the test app - can we please send it to you to take a look? If so, what's the preferred way to send files to you?

Many thanks for your helps with this.

John