[Gambas-user] Problem with MySQL syntax with DataSource and DataView

Martin McGlensey mmcg29440 at ...3163...
Sun Aug 2 22:07:35 CEST 2015


Hello,

 

I have the code below in my MySQL/Mariadb project.

 

     DataSource1.Connection = modMain.$Con

     DataSource1.Table = "tblparcel_numbers"

     DataSource1.Filter = db.Subst("tblparcel_numbers.Key = &1",
frmEntry.DataControl10.Value)

     DataSource1.Sort = "Parcel_No"

     DataView1.View.Columns.Width = -1

         

     DataSource2.Connection = modMain.$Con

     DataSource2.Table = "tblparcel_numbers"

     DataSource2.Filter = db.Subst("tblparcel_numbers.Key != &1",
frmEntry.DataControl10.Value)

     DataSource2.Sort = "Parcel_No"

     DataView2.View.Columns.Width = -1

 

Coding for DataSource1 works as expected. Returning records with a key equal
to the contents of the data control.

 

Coding for DataSource2 Fails. The error message is "DataTable load until,
134: Query failed, You have an error in your SQL syntax".

 

The DataView2  shows some record numbers but nothing else. If you scroll
down you see the error message about a failure at              a specific
record. I've looked at the data and it appears to be OK. <,>,= all work but
!= or <> do not. All I get is a circular cursor indicating processing is
occurring but it looks like an endless loop. I want to load all records in
which the key is not equal to the datacontrol. What have I missed?

 

Using Gambas 3.8 with MySQL/MariaDB as the database.

 

Thanks,

Marty




More information about the User mailing list