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
Any help would be greatly appreciated!
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!
![:)](http://aut1.autoit-cdn.com/forum/public/style_emoticons/default/smile.png)