Hello,
I am using vb6 as front end and oracle as back end. i want to insert new row in database using adodc.
i put adodc1.recordset.addnew on command's click event....do i need to mention adodc1.recorset.save or adodc1.recorset.update?

and while executing the code text boxes are becoming blank whenever i goto next text box..i am unable to find the problem ,i check out rest the connection,service provider part etc..help me out...Thanks for reading...

if you are saving it to oracle i think u need to create RDO instance not ADO or maybe ADODC works fine....it is the update event that commits the changes to database.

The .update is to follow after the .add, then the data to update and then the .update.

The textboxes clearing its contents has nothing to do with your data connection at all. Post us the code for your add new data and the code currently under the text box. Somewhere there is code that calls the box to be cleared as in

Text1.Text = "" 'or
Text1.Text = vbNullString 'etc

Thanks all..its working fine with .update but its overwriting the single entry in the table again and again so i tried with .movelast still its overwriting...
part of code is -

Private Sub Command1_Click()
Adodc1.Recordset.MoveLast
Adodc1.Recordset.AddNew
'Adodc1.Recordset.Update
End Sub

Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub

You need some data to add before updating a record. That is why you are getting "overwriting"

Private Sub Command1_Click()
Adodc1.Recordset.MoveLast
Adodc1.Recordset.AddNew
'Add some data here OR if you are using your textboxes, make sure they contain some data.
If Text1.Text = vbNullString Then
   msgBox "Please add data" '...
   Text1.SetFocus
   Exit Sub
      Else
Adodc1.Recordset.Update
End If
End Sub

Secondly, try not to use "" in your code, rather use vbNullString as in -

Private Sub Form_Load()
Text1.Text = vbNullString
Text2.Text = vbNullString
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.