[Gambas-user] Syntax help for IF after a Try statement

rocko sunblaster5 at ...626...
Thu Aug 9 03:53:10 CEST 2012


Trying to get a message.info to display when a successful connection
to a database is made.
Tried using an 'Else If' after a 'Try $hConn.Open' statement
but that gives an error.
So tried a simple 'If' but I'm not sure how the syntax should be.

CODE:
 Try $hConn.Open
  If Error Then Print "Database cannot be opened. Error = ", Error.Text
  
  If $hConn.Open Then
      Message.Info("You are now connected to the database.")
      Endif





More information about the User mailing list