Le 03/02/2012 20:51, John Rose a écrit :
> I've looked at the Database example and I still don't understand how to
> use the DataSource&  DataBrowser controls.
>
> My DataSourceCountry control has its Table property set to country (one
> of the tables in the Test.db SQLite3 database in the Data directory of
> the attached Test project. In the Form_Open procedure, the variable
> DatabaseConnection was previously created successfully (i.e. before I
> added these 2 controls) and database opened OK. In that procedure, the
> Connection property of DataSourceCountry is set to this variable: should
> I do that? My DataBrowserCountry control has Columns set to country
> (which is one of the columns in the country table, though not the
> primary key) and Editable set to True. The project compiles&  saves OK.
>
> When I try to run it, a popup comes up either with 'Null object' or
> 'Driver name missing'. Any ideas please.
>

If the DataSource Connection property is not set, then DataSource will 
use the default connection object, which is usually the first one 
created. In your code, this is the "Private DatabaseConnection As New 
Connection", which is not initialized.

So the 'Driver name missing' error, because DataSource tries to open 
that connection object during form instanciation, before Form_Open is 
called.

Another point: DataSource is a container. Every other control that 
depends on it must be put *inside* it.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to