Microsoft SQL

92 views
Skip to first unread message

Nolan Bradshaw

unread,
Feb 6, 2015, 3:52:13 PM2/6/15
to haxe...@googlegroups.com
Has anyone successfully used Microsoft SQL with Haxe. I am attempting to make an application with haxeui for a small maintenance application that has an SQL Connection. Also, we are looking at possibly making this to talk to agilent and other devices however, I have yet to see anything regarding this as well. Any help with Microsoft SQL would be good. I'm not a new programmer, but their isint much information regarding this topic.

Thank you,
Nolan Bradshaw

Nolan Bradshaw

unread,
Feb 7, 2015, 4:01:45 PM2/7/15
to haxe...@googlegroups.com
No one has done this yet? I would think I would have received some sort of instruction forward. I guess I will have to make a ndll or something for microsoft sql. :(

Cauê Waneck

unread,
Feb 7, 2015, 4:10:51 PM2/7/15
to haxe...@googlegroups.com
Hi,

In a recent Haxe build, there's support for all ADO.NET compatible drivers if you're compiling to C#. It's still very experimental, but it passes the database tests in Haxe - which are still not many.

The class is called `cs.db.AdoNet`: https://github.com/HaxeFoundation/haxe/blob/development/std/cs/db/AdoNet.hx#L5
In order to use it, you'll need to reference the `System.Data` assembly using `-net-lib` like this: https://github.com/HaxeFoundation/haxe/blob/development/tests/unit/compile-cs-travis.hxml#L3

With this setup, you'll be able to connect to any MS SQL database.

Cheers
Cauê

2015-02-07 19:01 GMT-02:00 Nolan Bradshaw <nolanjb...@gmail.com>:
No one has done this yet? I would think I would have received some sort of instruction forward. I guess I will have to make a ndll or something for microsoft sql. :(

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Nolan Bradshaw

unread,
Feb 9, 2015, 1:25:04 PM2/9/15
to haxe...@googlegroups.com
I'm getting a permission denied even though i've  added a directory cs_drivers and placed the dll in there I always changed permissions something is going on where it just wont install easily.I'll keep hacking at it

You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.

Cauê Waneck

unread,
Feb 9, 2015, 1:34:56 PM2/9/15
to haxe...@googlegroups.com
You're probably making the output directory to be in a place inside your haxe installation. It's best to copy the cs_drivers somewhere else, and use it from there.

Cauê Waneck

unread,
Feb 9, 2015, 1:36:57 PM2/9/15
to haxe...@googlegroups.com
Also note that with -net-lib you can ditch the sys.db.* implementation completely and use the ado.net interface itself.

Nolan Bradshaw

unread,
Feb 9, 2015, 1:59:43 PM2/9/15
to haxe...@googlegroups.com
Update: I'm not receieving this error:
File "ilMetaReader.ml", line 281, characters 36-42: Assertion failed
error 0x2

Nolan Bradshaw

unread,
Feb 9, 2015, 2:01:52 PM2/9/15
to haxe...@googlegroups.com
Let me correct that I am now receiving that error

Cauê Waneck

unread,
Feb 9, 2015, 2:03:21 PM2/9/15
to haxe...@googlegroups.com
Are you using only the -net-libs specified at cs_drivers? Are you using a recent haxe build? If possible, can you update to the very latest? You can download a build at builds.haxe.org

Also, can you share the code you're using?

Nolan Bradshaw

unread,
Feb 9, 2015, 2:33:20 PM2/9/15
to haxe...@googlegroups.com
Yes, I got the latest build from the development branch
I grabbed a dll that I was using that was compiled in a previous .net application.
The only thing is that the haxelib i'm using shows version 3.1.0rc-4
haxe compiler version Haxe Compiler 3.2.0  (git build development @ 216083e)
I installed hxcs,..

The build.hxml I have is currently
--build.hxml--
-main Main
-cs Main.cs
#for ado.net
-net-lib "D:\Development\HaxeProjects\cs_drivers\System.Data.dll"

current error:
File "ilMetaReader.ml", line 281, characters 36-42: Assertion failed
error 0x2

I might be doing this incorrectly, as I'm only a week old in haxe. If I am  doing it wrong please let me know.

As of now I have an SQL class that basically has nothing
--SQL.hx--
package ;

import sys.db.Connection;

class SQL 
{
private static var connection:Connection;



}

Cauê Waneck

unread,
Feb 9, 2015, 2:38:08 PM2/9/15
to haxe...@googlegroups.com
Hmm I don't see the problem on Linux:
$ haxe -cs cs -main Main -net-lib /usr/lib/haxe/tests/unit/cs_drivers/System.Data.dll                                                                                                                                                            
haxelib run hxcs hxcs_build.txt --haxe-version 3200 --feature-level 1

Can you try the very latest version? I've been working actively on -net-lib lately, and you might just have happened to grab an unstable version.

Nolan Bradshaw

unread,
Feb 9, 2015, 2:41:45 PM2/9/15
to haxe...@googlegroups.com
I'm on windows
my current version i am using is 

Cauê Waneck

unread,
Feb 9, 2015, 2:43:57 PM2/9/15
to haxe...@googlegroups.com
I've just realized that you're using another dll that was not the one used by the haxe tests. Can you upload this somewhere and open an issue so we can check this out without polluting the list?

Thanks!
Reply all
Reply to author
Forward
0 new messages