---------- Messaggio inoltrato ----------
Subject: Re: [Gambas-user] Help DataSource, DataBrowse Date: 11:16, domenica 6 settembre 2009 From: Pino Zollo <pinozo...@gmail.com> To: Benoît Minisini <gam...@users.sourceforge.net> Alle 08:21, domenica 6 settembre 2009, hai scritto: > > 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 > > You must open your connection before showing the form having the > DataSource. Thanks Benoît, but the connection is already opened when I show the form so the problem must be elsewhere. > And in Gambas 3, you can specify explicitely a DataSource Connection > object. Good ! looking forward for the official release of Gambas 3. Any chance to have it also on GAMBAS 2 ? A bien tot Pino -- Key ID: 0xF6768208 Key fingerprint = B16D 0A7C 5B29 A334 CE6A 71F6 EAF8 3D88 F676 8208 Key server: hkp://wwwkeys.eu.pgp.net ------------------------------------------------------- -- Key ID: 0xF6768208 Key fingerprint = B16D 0A7C 5B29 A334 CE6A 71F6 EAF8 3D88 F676 8208 Key server: hkp://wwwkeys.eu.pgp.net ------------------------------------------------------------------------------ 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