speedy6 Posted July 20, 2007 Share Posted July 20, 2007 Hi, In the following code i make a connection to my database and it works fine BUT when i zet my firewall on BLOCK ALL. I get a error on the following line: $Objconn.open ("DRIVER=" & $sDriver & ";SERVER=" & $sServer & ";DATABASE=" & $sDatabase & ";UID=" & $sUsername & ";PWD=" & $sPassword & ";") I cannot catch it with the following code...so how can I solve it? $Objconn.open ("DRIVER=" & $sDriver & ";SERVER=" & $sServer & ";DATABASE=" & $sDatabase & ";UID=" & $sUsername & ";PWD=" & $sPassword & ";") If @error Then SetError(1) Return 0 Else ... Thanks Speedy Link to comment Share on other sites More sharing options...
Zedna Posted July 20, 2007 Share Posted July 20, 2007 $objErr = ObjEvent("AutoIt.Error","MyErrFunc") Func MyErrFunc() ; when COM error occurs only set @error flag and continue SetError(1) EndFunc $Objconn.open ("DRIVER=" & $sDriver & ";SERVER=" & $sServer & ";DATABASE=" & $sDatabase & ";UID=" & $sUsername & ";PWD=" & $sPassword & ";") If @error Then ; ... EndIf Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
speedy6 Posted July 21, 2007 Author Share Posted July 21, 2007 thx And another question? I can't get parsed this function...why? Func _close() TraySetState(2); Opt("TrayIconHide", 1); exit EndFunc Link to comment Share on other sites More sharing options...
Zedna Posted July 21, 2007 Share Posted July 21, 2007 thx And another question? I can't get parsed this function...why? Func _close() TraySetState(2); Opt("TrayIconHide", 1); exit EndFunc Func _close() TraySetState(2) Opt("TrayIconHide", 1) exit EndFunc It's not Pascal so no need to have ; at end of lines :-) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
speedy6 Posted July 22, 2007 Author Share Posted July 22, 2007 Func _close() TraySetState(2) Opt("TrayIconHide", 1) exit EndFunc It's not Pascal so no need to have ; at end of lines :-) Now thats not the solution... can I call the function exit in a function? Link to comment Share on other sites More sharing options...
speedy6 Posted July 23, 2007 Author Share Posted July 23, 2007 problem solved Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now