Jump to content

Msgbox pops up with no value?


Recommended Posts

Friends,

PFA code snip for reference.

#include <_sql.au3>
#include <array.au3>
Opt ("trayIconDebug",1)
_SQL_RegisterErrorHandler() ; register the error handler to prevent hard crash on COM error
$oADODB = _SQL_Startup()
If $oADODB = $SQL_ERROR then Exit Msgbox(0 + 16 +262144,"Error",_SQL_GetErrMsg())
If _sql_Connect(-1,"ctsintcosinb","LPS_March_EAM_2011_02","ams","ams") = $SQL_ERROR then  ; ==> change server, database, user and password to your needs
    Msgbox(0 + 16 +262144,"Error",_SQL_GetErrMsg())
    _SQL_Close()
    Exit
EndIf
Local $avArray,$iRows,$iColumns
$iRval = _SQL_GetTable2D(-1,"select * from comp_pune",$avArray,$iRows,$iColumns) ; ==> Fetch data from comp_pune table
If $iRval = $SQL_OK then _ArrayDisplay($avArray, "Records from comp_pune table;")
Local $D_Start_Date,$D_End_Date,$G_Start_Date,$G_End_Date,$Fetch_Records,$Retreival_Time
$sqlCon= ObjCreate("ADODB.Connection")
$D_Start_Date=$sqlCon.execute("DECLARE @Start_Date datetime;")
$D_End_Date=$sqlCon.execute("DECLARE @End_Date datetime;")
$G_Start_Date=$sqlCon.execute("SET $D_Start_Date = getdate();")
$Fetch_Records=$sqlCon.execute("select * from dbo.all_lv_records_4report;")
$G_End_Date=$sqlCon.execute("SET $D_End_Date = getdate();")
$Retreival_Time=$sqlCon.execute("SELECT cast((datediff(ms, $G_Start_Date, $G_End_Date) / 60.0) as FLOAT) AS DiffMiliSecond;")
MsgBox(0+1,"Retreival_Time_Value_Msgbox1",$Retreival_Time)
$sqlCon.Close
_SQL_Close()

When I run the above code, _SQL_GetTable2D() function displays a list box as attached, with this post. But 'MsgBox(0+1,"Retreival_Time_Value_Msgbox1",$Retreival_Time)' pops up as a blank one. I couldn't deduce what is wrong with the code script and why this Msgbox pops up with no value? Could anyone help me out with this issue? Thanks.

post-64194-0-53050900-1304949859_thumb.p

Learning is Lifelong!
Link to comment
Share on other sites

Hi shreeks,

it seems that $sqlcon.execute just returns no value.

Did you try measuring the time using TimerInit() and TimerDiff() ?

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...