[Gambas-user] Database problem

nando nando_f at ...1382...
Thu Aug 17 14:52:36 CEST 2006


When you write to a record, DO NOT specify a KEY with a value:
So, if Id is the key, remove it from the INSERT statement.
Keys are (can be) automatic...don't set a value for them
If there are 1000 in the table, chances are the KEY already
has values from 1 to 1000 and Id=500 is a duplicate.


---------- Original Message -----------
From: Benoit Minisini <gambas at ...1...>
To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
Sent: Thu, 17 Aug 2006 14:49:49 +0200
Subject: Re: [Gambas-user] Database problem

> On Thursday 17 August 2006 13:41, juanra wrote:
> > - Id: 500
> > - First Name: PEPE
> > - Name: SASA
> >
> > The rest of fields in target.
> >
> > Pressing the icon [UTF-8?]“new” of the control of the Datasource and writing all
> > the Datacontrol and when pressing the icon [UTF-8?]“to [UTF-8?]keep” to insert it
in the
> > table leaves the error: [UTF-8?]“Cannot create record: Duplicate entry
[UTF-8?]“xxx” for
> > key [UTF-8?]1”.
> >
> > I am sure that I number of [UTF-8?]“Id:” not this duplicate in the table.
> >
> > It leaves the error and later it puts it in the table.
> >
> 
> Are you *really* sure? Because the example creates by default 1000 records in 
> the database, with ID from 0 to 999. The error message comes from the 
> database, and the database is rarely wrong!
> 
> -- 
> Benoit Minisini
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
------- End of Original Message -------





More information about the User mailing list