i am not able to add records with the help of ADODB. what is the problem i am not able to understand please help me. this is the code i written
Private Sub Form_Load()
Set rs = New ADODB.Recordset
rs.LockType = adLockBatchOpti mistic
rs.CursorType = adOpenKeyset
rs.ActiveConnec tion = cn
rs.Source = "select * from t"
rs.Open
End sub
Private Sub Command3_Click( )
rs.addnew
rs.Fields(0) = Text1.Text 'text1.text is character type data
rs.Fields(1) = Val(Text2.Text) 'text2.text is number type data
rs.Fields(2) = Val(Text3.Text) 'text3.text is number type data
rs.Update
End sub
please solve my above code.
Private Sub Form_Load()
Set rs = New ADODB.Recordset
rs.LockType = adLockBatchOpti mistic
rs.CursorType = adOpenKeyset
rs.ActiveConnec tion = cn
rs.Source = "select * from t"
rs.Open
End sub
Private Sub Command3_Click( )
rs.addnew
rs.Fields(0) = Text1.Text 'text1.text is character type data
rs.Fields(1) = Val(Text2.Text) 'text2.text is number type data
rs.Fields(2) = Val(Text3.Text) 'text3.text is number type data
rs.Update
End sub
please solve my above code.