Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 10 of 11 total |
double entries |
Tue, Aug 12 2008 7:31 AM | Permanent Link |
"Norbert Stellberg" | Hello,
again a beginner problem: The table: Add('LOSNR',ftString,8,True); I insert in this table 1234 1235 1234 <= DBIsam does NOT insert this entry (it is double) But I see not any messages. How can I see a message, that an entry is already in database ? Sorry for this simple questions. with best regards Norbert |
Tue, Aug 12 2008 8:16 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Norbert
You don't get an error until you try and post the record. When you try that you should be warned that there's a duplication if you have a unique index set for the column. Until such time as you try and post you could always alter the data in the field so no warning is given. The other time you won't see a warning is if the exception gets "eaten" by your code. Roy Lambert [Team Elevate] |
Tue, Aug 12 2008 8:18 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Norbert
Another thought just occurred to me. If you are seeing the system issued warning but want to know how to handle this yourself have a look at the OnPostError event. Roy Lambert [Team Elevate] |
Tue, Aug 12 2008 10:25 AM | Permanent Link |
"Norbert Stellberg" | Hello Roy,
> Another thought just occurred to me. If you are seeing the system issued > warning but want to know how to handle this yourself have a look at the > OnPostError event. Thanks for your fastest help. But, I think you has not understand my problem. I have a field created in table with this line: Add('LOSNR',ftSTring,8,True); ^^^^^^^ That means, this field is only 1time in the table, isn't it ? Now I Insert DBTable1.Edit; DBTable1.Insert; DataSource1.DataSet.FieldByName('Losnr').AsString := '1234'; DBTable1.Post; ok. Now the next insert: DBTable1.Edit; DBTable1.Insert; DataSource1.DataSet.FieldByName('Losnr').AsString := '1234'; DBTable1.Post; Here I missing the exception, the entry '1234' does allways exist. I have not an error in onPostError, and not an error afterPost........ The program works ok. The second entry is NOT in the database. But I miss an error. I will show "this entry does exist!" I hope, you has understand what I mean. with best regards Norbert |
Tue, Aug 12 2008 11:06 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Norbert,
<< ^^^^^^^ That means, this field is only 1time in the table, isn't it ? >> No, it means that the field is required, which is different than unique. To make a field unique, you need to add a primary or unique index on that field. See here for more information on doing that: http://www.elevatesoft.com/manual?action=mantopic&id=dbisam4&product=d&version=7&category=1&topic=19 -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Aug 12 2008 12:32 PM | Permanent Link |
"Norbert Stellberg" | Hello,
> << ^^^^^^^ That means, this field is only 1time in the table, isn't it ? > >> > No, it means that the field is required, which is different than unique. Ups ! Ok, now I understand this. Thanks for support. with best regards Norbert |
Fri, Aug 15 2008 5:29 AM | Permanent Link |
"Frans van Daalen" | "Norbert Stellberg" <Stellberg@Stellberg.de> wrote in message news:CD6F36A8-6297-45CD-9347-69A82D0761FE@news.elevatesoft.com... > > Now I Insert > > DBTable1.Edit; > DBTable1.Insert; > DataSource1.DataSet.FieldByName('Losnr').AsString := '1234'; > DBTable1.Post; > No answer to your questions as Tim already did but.... Why do you first call DBTable1.Edit before the DBTable.Insert ? |
Fri, Aug 15 2008 11:43 AM | Permanent Link |
"Norbert Stellberg" | Hello,
> Why do you first call DBTable1.Edit before the DBTable.Insert ? I meanit is required , otherwise it comes an errormessage: Table is not in Edit mode. Isn't it ? with best regards Norbert |
Fri, Aug 15 2008 12:47 PM | Permanent Link |
"Norbert Stellberg" | Hello,
> I meanit is required , otherwise it comes an errormessage: Table is not in > Edit mode. Isn't it ? Again this topic. I had a look into the manual. Search: Edit Append Insert Allways the same message: Nothing found any entry for this................. What is wrong here ? (But I didn't found it in the online manual, too) with best regards Norbert |
Fri, Aug 15 2008 1:01 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Norbert,
<< Again this topic. I had a look into the manual. Search: Edit Append Insert Allways the same message: Nothing found any entry for this................. >> Are you searching the WinHelp version of the manual ? The Append/Insert/Edit methods are standard TDataSet methods, therefore we don't document them in our manual - they are documented in the standard Delphi manual. -- Tim Young Elevate Software www.elevatesoft.com |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Thursday, March 28, 2024 at 06:05 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |