[Gambas-user] Database error

ron ronstk at ...239...
Thu Jan 5 19:46:58 CET 2006


On Thursday 05 January 2006 19:32, Fabien Bodard wrote:
> Le Jeudi 5 Janvier 2006 13:08, Ron Gottstein a écrit :
> > Hello All,
> >
> > I amd using sqlite and sqlite3.
> > I've been trying to write some code to do simple
> > database operations.  I can create the database and
> > its table, however, i cant seem to insert any data
> > into the table.  I keep getting and error "Cannot
> > Create Record: Abort Due To Constraint Violation".
> > Please advise.  Below is the code to insert the data.
> >
> > Thank you,
> > Ron Gottstein

---8<---

> >   $hConn.Open
> >   $hConn.Begin
> >
> >   rTest = $hConn.Create("Addresses")
> >   rTest!First_Name = tbFirstName.Text
> >   rTest Last_Name = tbLastName.Text
> >   rTest Street = tbStreet.Text
> >   rTest City = tbCity.Text
> >   rTest State = tbState.Text
> >   rTest Zip_Code = tbZipCode.Text
> >   rTest Home_Phone = tbHomePhone.Text
> >   rTest Work_Phone = tbWorkPhone.Text
> >   rTest Cell_Phone = tbCellPhone.Text
> >   rTest Email = tbEmail.Text
> >   rTest Birthday = tbBirthday.Text
> >   rTest.Update
> >   $hConn.Commit
> > END
> >
> >
> >
> >
> 
> try to remove commit...
> 

When I Create a table I need to set the field types,
her you are direct putting data in undefinied field
if you do:  rTest = $hConn.Create("Addresses")
Create table does not have any field to put data in.

Or does sqllite auto-create fields with the wanted field names and types ?





More information about the User mailing list