[Gambas-user] Help DataSource, DataBrowse

Pino Zollo pinozollo at ...626...
Sun Sep 6 14:05:43 CEST 2009


Hi ,
Please an help....I am practising with DataSorce using into my project the 
same form and class of the "database" example: in particular Ftest.class and 
Ftest.form.

In my project I get the error:  

     Null Object DataSource.MoveFirst.173

I guess that DataSource can not find my Connection to the database ...

How can I tell to DataSource which is the Connection to use ?
Is there a property of DataSource to set ?

I make the connection in Mglobal.module with the following code:
-----
PUBLIC FUNCTION conn(dbtype AS String, host AS String, lgn AS String, pass AS 
String) AS Boolean

  TRY $hConn.close
  $hConn.Type = dbtype         '  "postgresql"  
  $hConn.Host = host
  $hConn.Login = lgn
  $hConn.Password = pass
  $hConn.Open
  RETURN TRUE
CATCH
  Message.error("conn", Error.Where & "\n" & Error.text)
  RETURN FALSE
END
-------
Where
PUBLIC $hConn AS NEW Connection
.....

Many thanks

Pino

-- 
Key ID: 0xF6768208 
Key fingerprint = B16D 0A7C 5B29 A334 CE6A  71F6 EAF8 3D88 F676 8208
Key server: hkp://wwwkeys.eu.pgp.net




More information about the User mailing list