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

SQL & @error

$
0
0
Alright, I'm bashing my head in on this one. Can anyone give me a hint as to why @error isn't catching when an invalid server is provided?

Instead, the script quits and provides this error:
C:\Scripts\EEG Data Migration.au3 (284) : ==> The requested action with this object has failed.:
$sqlCon.Open($sqlConStr)
$sqlCon.Open($sqlConStr)^ ERROR

[ autoit ]      
$sqlConStr = "DRIVER={SQL Server};SERVER=" & $strDbServer & ";DATABASE=MainExamDataDB;uid=TP;pwd=;" $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.Open($sqlConStr) If @error Then $dbConnectError = MsgBox(48, "Error", "Failed to connect to the database, please verify the server.") $sqlCon.Close WinActivate("EEG Data Migration Parameters") ControlFocus("EEG Data Migration Parameters", "", 5) Else queryStudiesToTransfer() EndIf

Any help would be greatly appreciated! :)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



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