Debian sid
gb 2.17
==========

Hi,

I've got a module with public string & connection:

PUBLIC $DBConn AS NEW Connection
PUBLIC MyHost AS String
PUBLIC MyDB AS String
PUBLIC MyUsr AS String
PUBLIC MyPass AS String
'---------------------------------
PUBLIC FUNCTION DBConnect() AS Boolean
PRINT MyDB & "." & MyHost & "." & MyUsr & ":" & MyPass
  WITH $DBConn
    .Type = "postgresql"
    .Host = MyHost
    .Name = MyDB
    .Port = "5432"
    .Login = MyUsr
    .Password = MyPass
  END WITH 
  TRY $DBConn.Open
  IF ERROR THEN 
     Message.Error(("Can't connect to DB") & "\n\n" & Error.Text)
    RETURN FALSE
  ELSE 
    RETURN TRUE
  ENDIF 
END

If I forget to fill MyHost & MyDB from the class that calls it, the 
function don't raise any error and returns TRUE (?)

How can that be?

JY
-- 
I don't care what star you're following, get that camel off my front lawn!
                -- Heard in Bethlehem

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to