|
-
Oct 31st, 2008, 12:07 PM
#1
Re: using ms acces with use in forms in add, delete, exit, update data record
Moved to Office Development
 Originally Posted by GaryMazzone
So what is the question
What is the answer to Gary's question?
-
Oct 31st, 2008, 01:26 PM
#2
Fanatic Member
Re: using ms acces with use in forms in add, delete, exit, update data record
Hello,
You can able to add,edit,update and delete records using ADODB. Project->Components->Microsoft ADO Data Control 6.0 (OLEDB)
Add that to the form
Now put 4 buttons as Add,Delete,Edit,Update
coding:
dim db as new ADODB.Connection
dim rs as new ADODB.recordset
private sub form_load()
db.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Final Full\EXE\horse.mdb;Persist Security Info=False"
Bold contents must be your database path
rs.open "Select * from details",db,3,2
This bold contents must be your recorset name where to add the datas.
end sub
Private sub add_click()
rs.addnew
rs.fields(0) = text1.text
rs.fields(1) = text2.text
etc
rs.update
msgbox "Data Added"
End sub
If my post was helpful pls rate me
-
Nov 1st, 2008, 02:59 AM
#3
Re: using ms acces with use in forms in add, delete, exit, update data record
 Originally Posted by bharanidharanit
Hello,
You can able to add,edit,update and delete records using ADODB. Project->Components->Microsoft ADO Data Control 6.0 (OLEDB)
Add that to the form
Now put 4 buttons as Add,Delete,Edit,Update
coding:
dim db as new ADODB.Connection
dim rs as new ADODB.recordset
private sub form_load()
db.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Final Full\EXE\horse.mdb;Persist Security Info=False"
Bold contents must be your database path
rs.open "Select * from details",db,3,2
This bold contents must be your recorset name where to add the datas.
end sub
Private sub add_click()
rs.addnew
rs.fields(0) = text1.text
rs.fields(1) = text2.text
etc
rs.update
msgbox "Data Added"
End sub
If my post was helpful pls rate me
Using data bound controls for DML are frowned upon since they are considered evil.
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
|