Closed efreibe closed 1 week ago
I'd love to understand the scenario better -- what are you building where ADO on the client is the right choice?
While it's theoretically possible, I think you might be better off with something like this: https://pub.dev/packages/dart_mssql
I need to support another server than mssql. Here is the link:
http://devzone.advantagedatabase.com/dz/content.aspx?key=20&Release=19
I'm thinking that adodb is the best option I have in this situation. Besides adodb can handle a variety of additional data stores like excel.
Do you see a better option here? There are other libraries in that page, I think that addressing the native library would be a mess.
Oh my! Yeah, that's quite a challenge. If I were building this today, I would probably create a native component in a more COM-friendly that does the heavy lifting work of getting data out of ADODB, and then expose that to Dart through a simpler interface.
What you're describing is theoretically possible with Dart, but you're pioneering into new territory. While I have IDispatch
wired up, I've not been able to successfully invoke a method using it. Unclear yet whether it's bad pointer management on my side or whether there's something more fundamentally broken.
If you're comfortable to be a pioneer, you can check the experimentation I've done so far here: https://github.com/timsneath/win32/blob/dotnet/example/dotnet/invoke.dart
I will take a look and see what can I do... thank you
@timsneath I've taken a look to the code you left in the past comment, I've made some arrangements and came up with the code below. Hope helps to complete the invoke
example:
I've added some free
functions to avoid leaks, but being a short example maybe could be better to remove them.
I will continue investigating how to port ADODB. Thank you.
This is fantastic! Thank you. You've fixed my pointer bug and this works nicely now.
I'll tidy up the sample and try and use it to do something slightly more sophisticated, but this gets us a big step closer to something like ADODB. Thank you.
You're welcome, let me know if you need any further help.
I'm wondering if it's too hard to implement ADODB (Connection, Command and Recordset at least), I've tried, but I can't figure out how to implement those interfaces completely.
I have some questions, for example, the typelib has definitions like
object
, that I do not how to convert to dart (I found over there that should be aLong
value?). And I've not found how to implement enum types.Moreover I do not know how to calculate the vtable indexes of methods and properties.
Here is an example of
_Connection
Interface that I've tried to implement, I do not know if the tool I've used reorders methods and properties, this makes more confusing to calculate vtable indexes.There is another way to tackle this? For example, using IDispatch/Invoke like old Visual Basic does?
Any help would be appreciated. Thank you.