Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

AutoIT and SQLEXPRESS

$
0
0
Hello to everyone,

I am having some problems and/or lack of ideas while doing one project.

My question here is :

Is it possible to extract data from a database, in the DDMMYY HH:MM:SS format (read: date/month/year hours:minutes:secs). The data is stored in that way in the database, but i cannot find any way to import it in Autoit in that format.

I am using the SQL example located here>  http://www.autoitscript.com/forum/topic/51952-sqlau3-adodbconnection/
and so far i can connect to the db and read the data, but nothing more.
This is my code >
#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 Msgbox(0 + 16 +262144,"Error",_SQL_GetErrMsg())

If _sql_Connect(-1,"NKOLEV\SQLEXPRESS","QSS","","") = $SQL_ERROR then
Msgbox(0 + 16 +262144,"Error",_SQL_GetErrMsg())
_SQL_Close()
Exit
EndIf
Local $aData,$iRows,$iColumns;Variables to store the array data in to and the row count and the column count
$iRval = _SQL_GetTable2D(-1,"SELECT INDTime, OUTDTime, DurationInSec, BatchID FROM ParkSubscriptionIOEvents WHERE (BatchID=67);",$aData,$iRows,$iColumns)
If $iRval = $SQL_OK then _arrayDisplay($aData,"2D (" & $iRows & " Rows) (" & $iColumns & " Columns)" )
_SQL_Close()


I want somehow to calculate the DurationInSec values and convert it to hours (the data is stored in seconds). There is more things i will need to add in the future, but for now i want to make this work. Any help/ideas/suggestions are wellcome

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>