[Gambas-user] db.delete always returning error

Timothy Marshal-Nichols timothy.marshal-nichols at ...247...
Tue Aug 15 17:43:03 CEST 2006


> -----Original Message-----
> From: gambas-user-bounces at lists.sourceforge.net
> [mailto:gambas-user-bounces at lists.sourceforge.net]On Behalf Of Ron
> Onstenk
> Sent: Tuesday, 15 August 2006 12:27
> To: mailing list for gambas users
> Subject: Re: [Gambas-user] db.delete always returning error
>
>
> On Tuesday 15 August 2006 09:07, rudy wrote:
> > Hi,
> >
> > I try to delete a record from table using db.delete, but it
> always returning
> > error message "Wanted Result got Void instead". However, the
> record IS DELETED
> > CORRECTLY.
> >
> > The procedure:
> >
> ------------------------------------------------------------------
> ---------------------------
> > PUBLIC SUB Delete_Transaction(nomor AS Integer)
> >
> >    DIM rs AS Result
> >    DIM criteria AS String
> >
> >    criteria = "nomor = &1"
> >
> >    db.Begin
> >
> >    rs = db.Delete("transaksi_tunda", criteria, nomor)
>

db.Delete(...) is a procedure not a function. It does not return a result.
You just need:

	db.Delete("transaksi_tunda", criteria, nomor)

all on it own sweet own. Look in the help.

> Are you sure db.Delete _is_ returning a Result ?
> A boolean True/false looks to me more the case.
>
>
> >
> >    rs.update
> >    db.Commit
> >
> >    CATCH
> >
> >    Message.Error(ERROR.text)
> >
> > END SUB
> >
> ------------------------------------------------------------------
> --------------------------------
> > Is there something wrong with above
> > procedure, or is it a bug ? (Using other db command such as db.Exec and
> > db.Edit, they work correctly, no error message).
> >
> > I use gambas 1.9.34 on Suse 10.0, database is MySQL 4.1.14.
> >
> > Thanks,
> > Rudy
> >
> >
>

Thanks

8-{)} Timothy Marshal-Nichols
<mailto: timothy.marshal-nichols at ...247...>






More information about the User mailing list