danisam Posted April 20, 2006 Share Posted April 20, 2006 (edited) 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 ;$o_ADOrs.close if @error Then return 0 return $o_ADOrs EndFunc 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 April 20, 2006 by danisam Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now