heya, sorry for my bad english language... *_*i wanna ask about it,i have the code like this :-----------------------------------Private Sub btnCommand_Click(Index As Integer)Select Case IndexCase 0If frmPetugasView.Tag = "New" Then frmPetugasView.Adodc1.Recordset.AddNew frmPetugasView.Adodc1.Recordset!PetugasID = txtInput(0).Text frmPetugasView.Adodc1.Recordset!NamaPetugas = txtInput(1).Text frmPetugasView.Adodc1.Recordset!Keterangan = txtInput(2).Text frmPetugasView.Adodc1.Recordset.Update ElseIf frmPetugasView.Tag = "Edit" Then frmPetugasView.Adodc1.Recordset!PetugasID = txtInput(0).Text frmPetugasView.Adodc1.Recordset!NamaPetugas = txtInput(1).Text frmPetugasView.Adodc1.Recordset!Keterangan = txtInput(2).Text frmPetugasView.Adodc1.Recordset.Update End IfCase 1Unload MeEnd SelectEnd Sub-------------------------------when i gonna input new data, it show entered data at frmPetugasViewbut, when i put same number at primary key then the vb6 show this error code (run time error 80004005)my teacher show me about using 'if' command for using EOF and BOF for denying same data at primary key, but i lost contact with her for a month.can someone help me??~i hope the code is :option 1 =when same data entered, input aborted and show dialog with information about aborted processoption 2 =generate +1 number at last of ID at primary key (i'm using number for primary key)but i need option 1 better than 2 (i just need that both for my studying... but i need the first one for my project)
Tags: