Subject | Post on required fields |
---|---|
Author | Fernando Azevedo |
Post date | 2007-04-16T19:51:14Z |
I have two questions:
I'm working with three tables: Book, Author and Book_Author. When
inserting a new book, I open the Author table and select the ones I want
do associate with the book, and that will be put in the Book_Author
table. To do that, I use this :
qryBook_Author.Insert;
qryBook_Author.FieldByName('BOOK_ID').AsInteger :=
qryBook.FieldByName('BOOK_ID').AsInteger;
qryBook_Author.FieldByName('AUTHOR_ID').AsInteger :=
qryAuthor.FieldByName('AUTHOR_ID').AsInteger;
qryBook_Author.Post;
If I use this without entering all the not null fields, I get an
error informing that the required fields cannot be null. Of course they
can't, by I'm just using a Post, not a Commit ! Is it necessary that all
the not null fields of the master table to be filled before I use a Post
command ?
Nevertheless, if I fill the required fields, and try to use the code
above, I get the error: "Problem in binding cursor". What's this about ?
Thanks in advance
Fernando Azevedo
I'm working with three tables: Book, Author and Book_Author. When
inserting a new book, I open the Author table and select the ones I want
do associate with the book, and that will be put in the Book_Author
table. To do that, I use this :
qryBook_Author.Insert;
qryBook_Author.FieldByName('BOOK_ID').AsInteger :=
qryBook.FieldByName('BOOK_ID').AsInteger;
qryBook_Author.FieldByName('AUTHOR_ID').AsInteger :=
qryAuthor.FieldByName('AUTHOR_ID').AsInteger;
qryBook_Author.Post;
If I use this without entering all the not null fields, I get an
error informing that the required fields cannot be null. Of course they
can't, by I'm just using a Post, not a Commit ! Is it necessary that all
the not null fields of the master table to be filled before I use a Post
command ?
Nevertheless, if I fill the required fields, and try to use the code
above, I get the error: "Problem in binding cursor". What's this about ?
Thanks in advance
Fernando Azevedo