[Gambas-user] DATE function Gambas 3.8.4 (Distro)

Gianluigi bagonergi at gmail.com
Fri Jul 19 20:21:07 CEST 2019


Il giorno ven 19 lug 2019 alle ore 18:02 David Silverwood via User <
user at lists.gambas-basic.org> ha scritto:

> Me again
>
> Thanks to everyone here I've managed to get a semi working program. Just
> one question. What am I missing in this code? No error is raised yet an
> item is not deleted? My save instruction and load instructions work fine,
> but both update and delete don't commit... what am I missing?
>
> Public Sub btnDelete_Click()
>
>     $Request = "SUPPLIER = &1 AND QUOTE_NO = &2"
>
>     Inc Application.Busy
>
>     conMod.$Con.Begin()
>
>     conMod.$Con.Delete("PREPAIDS", $Request, Trim(cboSupplier.Text),
> Trim(edtQuoteNo.Text)) 'according to gb.db this is a subroutine, so doesn't
> return a result?
>     conMod.$Con.Commit()
>
>     btnClear_Click()
>
> Finally
>     Dec Application.Busy
>
> Catch
>     conMod.$Con.Rollback()
>     objErr.dhError()
>
> End
>

You can add this code to the end of the SQLiteDateTest code after  'Print
Format(hResult["birth"], "dd/mm/yyyy")  :

  hConn.Delete("users", "id=&1", 1)
  hResult = hConn.Find("users") ' get error: Result is not available
  Print Left(Str(hResult["birth"]), 10) ' don't work
  hConn.Close
Catch
  hConn.Close
  Print Error.Text

End

Hope that helps
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190719/793369c4/attachment.html>


More information about the User mailing list