Jump to content
Sign in to follow this  

ObjEvent on ADO.Connection not returning strings

Recommended Posts


I have Created an Event Handler for ADO.CONNECTION the functions do fire but the strings contain gibberish. The Long and Int return okay. I have looked up the interface and they should be returning Wstrings.. First ANybody know what a Wstring is ?? Im assuming that it is a Wide String, and how could that be converted in Auto-It to a human readable string. Thanks for any help you can give. I am connecting to a SQL Server 2008 server but you can connect to anything to test I believe

Below is the Function prototype givin by PowerBasic COM browser.

WillConnect <6> (ByRef InOut ConnectionString As WString, ByRef InOut UserID As WString, ByRef InOut Password As _

WString, ByRef InOut Options As Long, ByRef InOut adStatus As Long, Byval pConnection As Int__Connection)


const $ConnInterface = "ConnectionEvents"

$conn = ObjCreate("ADODB.Connection")
$connEvent = ObjEvent($conn,"EVENTS_",$ConnInterface)

if @error then
Msgbox(0,"AutoIt COM Test", _
"ObjEvent: Can't use event interface '"& $ConnInterface &"'. Error code: " & hex(@error,8))


$conn.open ("Provider=SQLNCLI10;Server=ServerName;Database=Database;Uid=UID;pwd=pwd")


Func EVENTS_ConnectComplete($ugh3,$ugh,$ugh1)

MsgBox(0,"ADO EVENT","Connected to DataBase")

Func EVENTS_Disconnect($ugh4,$ugh5)

MsgBox(0,"ADO EVENT","Disconnected from DataBase")

Func EVENTS_WillConnect($ConnectionString,$val2,$val3,$val4,$val5,$val6)
Msgbox(0,"Connection String",string($ConnectionString))

Share this post

Link to post
Share on other sites

This was a bug. It was fixed August 21, 2012. Unfortunately the fix revealed another issue with internal variant string type, so I can't recommend going for beta for this. Make bug report if you don't mind and I will explain the issue furher for other developers in case development doesn't start while I'm around.




Share this post

Link to post
Share on other sites

Bug report submitted.. Its not a big priority. Just would like it to work for future things Im working on. Thanks Again..

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this