Error on edit/save RowSet orginated by SQLDatabaseMBS

Hi, I’m trying to edit and save a RowSet generated by SQLDatabaseMBS (as I did with xojo’s native MySQL plugin). When I try to use the Rowset.Save method,
I get this error: “Cannot query table named [table name] from SQL.”
Does anyone have any information on this? tnx.

This is the code that i use :

Sub Pressed()
  
  Dim db As New SQLDatabaseMBS
  
  db.DatabaseName="mysql:127.0.0.1,3306@attivita"
  db.UserName="usertest"
  db.Password="pswtest"
  Dim f As  FolderItem= New FolderItem("C:\Program Files\MySQL\MySQL Server 5.7\lib\libmysql.dll")
  Call SQLGlobalsMBS.SetDllDirectory("C:\Program Files\MySQL\MySQL Server 5.7\lib")
  
  db.Option("CLIENT_MULTI_STATEMENTS") = "true"
  db.Option("CLIENT_MULTI_RESULTS") = "true"
  db.Option("AutoCache") = "true"
  
  db.SetFileOption SQLConnectionMBS.kOptionLibraryMySQL, f
  Try
    db.Connect
  Catch err As RuntimeException
    Exit Sub
  End Try
  
  Try
    Dim rs As  RowSet
    rs=db.SelectSQL("select * from allegati limit 1 ")
    rs.EditRow
    rs.Column("note").Value="zazo"
    rs.SaveRow
  Catch err As RuntimeException
    err=err
  End Try
  
 
End Sub

Break at 23, step, and observe where it fires. The error may claim that allegati table does not exist in the DB it was connected at the select, or some internal error Christian should track at 24 or 26.

Your Exit Sub could be just Return, but in any case it will cause ugly silent errors. Think about it.

the “allegati” table exists and returns a record in rs rowset as you can see from this image

this is what rs contains after select

So it breaks at edit, assign, or save?

at .save

You need Christian help. There’s a problem there.

1 Like

Thanks. You found a bug in my code to find the table name in the SQL string.

Should be fixed in next release.

1 Like

Ok, i work around the problem (i’ ll create an update string composed of fields nane and values from the recordset)

Since my MBS licence expired on 1 october 2025 :grimacing::grimacing::grimacing::grimacing:

Thank you Christian