|
-
Nov 23rd, 2006, 08:29 PM
#1
Thread Starter
Fanatic Member
update ado database
hello,i need help!
1)how to immediately update recordset and perform the sql query i request?
VB Code:
Private Sub cmdtest_Click(Index As Integer)
On Error Resume Next
With rs
.Fields("Location") = Txtlocation.Text
.Fields("DatePurchase") = DTPpurchase
.Fields("Item") = dcomboitem.Text
.Fields("Detail") = Txtitem2.Text
.Fields("IDNumber") = Txtidnumber.Text
.Fields("Price") = Txtprice.Text
.Fields("Status") = Combostatus.Text
.Fields("DateScrap") = DTPScrap
.Fields("Deletedate") = Txtdeldate.Text
Call clear
If MsgBox("are you sure want to update", vbOKCancel + vbExclamation, "update Record") = vbOK Then
.Update
Call display1
End If
End With
end sub
Private Sub display1()
Adodc1.ConnectionString = JetConnection
Adodc1.Refresh
Adodc1.RecordSource = "SELECT *from Inventory where Deletedate is Null"
Adodc1.Refresh
End Sub
thanks!
-
Nov 23rd, 2006, 11:28 PM
#2
Re: update ado database
Using data controls, you are at their mercy. I would suggest you use an ADO SQL Insert statement followed by a ADO SQL Select statement to get your data.
Also why are you using On Error Resume Next. If there is an error you will attempt to get the data anyway and it wont be updated so how can you tell what went wrong?
Remove it and work out the errors...
-
Nov 24th, 2006, 12:33 AM
#3
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|