recordset can't not save,open and delete record,
Printable View
recordset can't not save,open and delete record,
If you SEARCH for ADODC, you'll find many people that know that it DOES work.
If they had a problem, they'd post their CODE, the error message, and the line it's on.Welcome, btw!Code:
' Code Tags
The ADODC does indeed work but I would not use it, ADO Code is a better choice and gives you more control.
At any rate if it is not working then you have probably set something wrong on the properties of the control.
I Assume your connection string is Ok .try the following way !
:wave:Code:
Private Sub Command1_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("IPID") = Text1.Text
Adodc1.Recordset.Fields("IPNAME") = Text2.Text
Adodc1.Recordset.Update
End Sub
You don't even CHECK? That would crash the app if the connection wasn't working!
ok i have tried and everything is working like a charm like Add NewRecord and delete .try the following way ! .
:wave:Code:
Option Explicit
Private Sub btAddnew_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("IPID") = TXTIP.Text
Adodc1.Recordset.Fields("IPNAME") = TXTIPDETAIL.Text
Adodc1.Recordset.Update
End Sub
Private Sub btDelete_Click()
Adodc1.Recordset.Delete
End Sub
Private Sub Form_Load()
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\JoseProject\ServerMaintenance.mdb;Persist Security Info=False"
.RecordSource = "Select * from StoreServersDetail"
End With
Set TXTIP.DataSource = Adodc1
Set TXTIPDETAIL.DataSource = Adodc1
TXTIP.DataField = "ipid"
TXTIPDETAIL.DataField = "ipName"
End Sub