Hello all, I have been using Autoit for a couple years, and over time have been learning as I go. Recently I have expanded into using SQL. At my work we have a million little queries that we use all the time. We use SQL 2000, so I found the _sql.au3 which has done wonders.
I have all my queries running nicely. However there is one issue that I have not been able to see the solution for even as I have searched the forum allot for. When I run a select statement, and there are no results, it doesn't display anything, but if there is results, it displays it in 2d array. Is there a piece of code that I can add that if there are no results it will display a msg box or something. Here is some of my code.
Let me know if I can provide any other information.
#include <array.au3>
#include <_sql.au3>
_SQLRegisterErrorHandler();register the error handler to prevent hard crash on COM error
$listname = 'TDCS08'
$con = _SQLStartup()
If @error then Msgbox(0,"Error","Error starting ADODB.Connection")
_SQLConnect(-1,"toronto4","gcti_500",'Username','password')
if @Error then Msgbox(0,"",$SQLErr)
$Query = "select top 20 * from " & $ListName
$data = _SQLExecute(-1,$Query)
If Not @error then
$aData = _SQLGetData2D($data)
_arrayDisplay($aData)
Else
Msgbox(0,"",$SQLErr)
EndIf
_SQLClose()