Jump to content
Sign in to follow this  

Can't Get Back Result

Recommended Posts


I am using Autoit to attack an ms-sql server 2000 Database.

i use ms-sql.au3 library function :

Func _SQLCommand($o_ADOcn, $s_Query, $cmd_TimeOut=900)

    Local $o_ADOCmd, $o_ADOrs
    $o_ADOCmd = ObjCreate("ADODB.Command")
    $o_ADOrs = ObjCreate("ADODB.Recordset")
    $o_ADOCmd.ActiveConnection = $o_ADOcn
    $o_ADOCmd.CommandText = $s_Query
    $o_ADOCmd.CommandTimeOut = $cmd_TimeOut
    $o_ADOrs = $o_ADOCmd.Execute
    if @error Then return 0
    return $o_ADOrs

My autoit code is :

Dim $o_ADOrs

$o_ADOrs = ObjCreate ("ADODB.Recordset")

 $s_Query = "Exec Diirect_Reports_InsertPronostico " _
  & "'" & $FechaInsert & "'" & "," _
 & "'" & $FechaHora & "'" & "," _
 & $Temperatura & "," _
 & $Humedad & "," _
 & $presion

$o_ADOrs = _SQLCommand($o_ADOcn, $s_Query, $cmd_TimeOut)

this code execute very well my stored procedure (is an insert statment, an it's returning an int value, 1 or 2)

After the sqlcommand my ADO recordset : $o_ADOrs is closed and i canĀ“t get back the return value, even if i search in : $o_ADOCmd

how can i do to perform that ?

Thanks for your help.

Edited by danisam

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.