Jump to content
Sign in to follow this  
speedy6

sql error

Recommended Posts

speedy6

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

Share this post


Link to post
Share on other sites
Zedna

$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

Share this post


Link to post
Share on other sites
speedy6

thx

And another question?

I can't get parsed this function...why?

Func _close()

TraySetState(2);

Opt("TrayIconHide", 1);

exit

EndFunc

Share this post


Link to post
Share on other sites
speedy6

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?

Share this post


Link to post
Share on other sites
speedy6

problem solved

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×