(How) can I embed Ado Classes in my project?

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Intexso
Posts: 84
Joined: Mon Sep 10, 2018 3:19 pm
Location: Nederland

(How) can I embed Ado Classes in my project?

Post by Intexso »

Hello,

In my VO project I used VOADO28.AEF. I used VOXPorter to convert it. After that I added this as application in XIDE in my project.

A lot of errors occurred, like:
error XS9002: Parser: unexpected input '_DLL' 11,1 Stream.prg VoAdo28
error XS9002: Parser: mismatched input ':' expecting {CLASS, DLLEXPORT, EXPORT, EOS} 11,35 Stream.prg VoAdo28
error XS9002: Parser: mismatched input '.' expecting EOS 11,44 Stream.prg VoAdo28


Is it already possible to use ado classes?
And if, how can I embed the ado classes in my project?

Thanks in advance for your answer!

Eric
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

(How) can I embed Ado Classes in my project?

Post by wriedmann »

Hi Eric,

currently you would need the Vulcan version of VO2Ado.

It is not possible to move VO2Ado using the XPorter, it uses to many VO interna that cannot be used under .NET.
Since I use VO2Ado myself, I have acquired VN2Ado a few years ago: https://www.heliks.nl/products/vn2ado

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

(How) can I embed Ado Classes in my project?

Post by wriedmann »

Hi Eric,

if I understand you correctly, you have not xported the VO2ADO sources itself, but only the interface library.
That cannot work since a VO DLL is not like a C DLL, and cannot be used by a foreign language application (in this sense, X# is a foreign language DLL as it does not uses the VO runtime).

To use VO libraries in X#, you must move them to X# too, and with the VO2ADO this will not work as I wrote before.

X# is very compatible to VO, but some people (and I cannot exclude myself) have done some things that were possible with VO, but are impossible under the .NET runtime.
I don't know if you have the Professional version of VO2ADO (that comes with sources), but I would not even try to move it.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Jamal
Posts: 316
Joined: Mon Jul 03, 2017 7:02 pm

(How) can I embed Ado Classes in my project?

Post by Jamal »

Since there is no solution via VO2ADO as Wolfgang mentioned, I would suggest you use what the .NET framework provides already.

In your app:

USING System.Data
USING System.Data.SqlClient

Then use whatever code you want to connect and manipulate your sql tables.

This link may help you to get on track easily:
https://www.javatpoint.com/ado-net-tutorial

The code is in C#, but it is very easy to convert to X#. There are so many tutorials out there on the web.

Jamal
User avatar
Intexso
Posts: 84
Joined: Mon Sep 10, 2018 3:19 pm
Location: Nederland

(How) can I embed Ado Classes in my project?

Post by Intexso »

Hi Wolfgang and Jamal,

Thanks for your answers.

(Indeed, I was xporting the interface. I already thought that was a dead end)

If I understand correctly, it is possible to link vn2ado in my project? I will look to that,

@Jamal. I am trying to port my (fairly big) VO application to X# with (I hope) minimal effort. It seems to me that your suggestion takes a lot of time (for me). If my application runs, than I hope to make my code more smart.

Eric
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

(How) can I embed Ado Classes in my project?

Post by wriedmann »

Hi Eric,

Code: Select all

If I understand correctly, it is possible to link vn2ado in my project? I will look to that,
that should work. Since you probably at the moment are using the Vulcan runtime for the migration, you should have no problem using VN2ADO in binary form. What VN2ADO is missing is the RDD, but there seems to be very few people using it.

And I'm pretty sure Robert will deliver a native X# version of VN2ADO, maybe called XS2ADO <g>.

I will need that for myself, and I know other people too.

What will be a dead end is VO2Jet, there is no Vulcan version for it, and I have migrated my VO2Jet code to VO2ADO.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Jamal
Posts: 316
Joined: Mon Jul 03, 2017 7:02 pm

(How) can I embed Ado Classes in my project?

Post by Jamal »

Hi Eric,

I understand where you are coming from and the task at hand, but the way I see it now is that VO2ADO just reinvents the wheel for something that's already in .NET and it acts as a wrapper. It was needed with VO, but not in .NET. As time goes on you will realize, it is better to go with ADO .NET route.

Jamal
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

(How) can I embed Ado Classes in my project?

Post by wriedmann »

Hi Jamal,

PMFJI, but if comes to transport a large VO application to X#, ADO.NET is not an option. It may become an option in the longer run, when the applications evolves, but not in the first migration step.
If a migrated application runs, a migration to ADO.NET may become an option.
Please don't forget that VO2ADO/VN2ADO delivers VO DataServer classes - code that would be need to be rewritten for ADO.NET.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Intexso
Posts: 84
Joined: Mon Sep 10, 2018 3:19 pm
Location: Nederland

(How) can I embed Ado Classes in my project?

Post by Intexso »

Hi Wolfgang,
Thanks
Eric
Post Reply