[Gambas-user] DataSource & DataBrowser problem

John Rose john.aaron.rose at ...626...
Tue Feb 7 16:25:54 CET 2012


Thanks, Benoit, for your explanation. Now that I've deleted the
DataBrowserCountry control & created it again inside the
DataSourceCountry control, I now see the countries (i.e. France & Great
Britain) in the DataBrowserCountry control.

However, when I try to add a new country (e.g. Fz), it moves the cursor
to a blank line following Great Britain and I key in Fz. When I click
the save button (in the DataBrowserCountry control), it comes up with a
dialog box saying 'Connection not opened' with OK button only (and
clicking OK does not result in saving). This also happens if I try to
change a country's name & save it. The DataBrowserCountry control has
Editable set to true as shown in the code fragment from the FMain class
which calls the FCountryMaintenance form:
Public Sub ButtonCountryMaintenance_Click()
  Dim hForm As FCountryMaintenance
  hForm = New FCountryMaintenance
  hForm.DataSourceCountry.Connection = MDatabase.DatabaseConnection
  hForm.DataSourceCountry.Table = "country"
  hForm.DataSourceCountry.Update()
  hForm.Refresh()
  hForm.DataBrowserCountry.Columns = ["country"]
  hForm.DataBrowserCountry.Editable = True
  hForm.DataBrowserCountry.Update()
  hForm.DataBrowserCountry.Refresh()
  hForm.Show() 
  hForm.DataBrowserCountry.SetFocus()
  Me.Hide()
End

PS I do not see a property named Labels for either control class in the
documentation. When I run my app, I see 'country', i.e. the country
table's column name, as the column label.





More information about the User mailing list