[Gambas-user] Fwd: Re: Help DataSource, DataBrowse

Pino Zollo pinozollo at ...626...
Mon Sep 7 14:42:17 CEST 2009



----------  Messaggio inoltrato  ----------

Subject: Re: [Gambas-user] Help DataSource, DataBrowse
Date: 11:16, domenica 6 settembre 2009
From: Pino Zollo <pinozollo at ...626...>
To: Benoît Minisini <gambas at ...1...>

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




More information about the User mailing list