Library code snippets
Basic ADODC Example
By Moriel Schottlender, published on 14 Jan 2004
Too all you newbies out there, This is something I wrote for a friend of mine, teaching how to use the basic extraction-from-db utilities. It shows how you can link an Access database using the ADODC Component. It includes thorough explanations and examples.
It really is teaching the basics of ADODC components - nothing fancy - I just remembered my own time as a beginner, trying to search for new ways to learn. I hope it will help you :)
~moo
Related articles
Related discussion
-
Key_Press() event for text box
by Aquila (1 replies)
-
Regarding Visual Basic Programme
by manjunathsl2007 (0 replies)
-
how do you hide all in VB6
by CapnJack (1 replies)
-
Problem with Input File
by novavb6 (3 replies)
-
How to produce a txt file with a table??
by novavb6 (1 replies)
hello..i am wanting to search the access database that i made with the visual data manager.
I have a search button, datagrid, an adodc connected to the database, its reading the database well alright on the VB 6.0 form.
I want to be able to click on the search button to fire even if no database has not yet been entered with Data without declaring bookmark within the code.
Whenever i click on the search button to fire the event to search the database, though it has not yet been populated with data, it flags and debugs the bookmark declaration.
Here is the code i used on the search button to search the access database on the vb form connected to the adodc.
Private Sub CmdSearchGrid3_Click(Index As Integer)
Dim searchvar As String
Dim sBookMark As String
searchvar = InputBox("Enter the Country to find")
searchvar = Trim$(searchvar) ' removes surplus spaces
If searchvar <> "" Then 'cancel if nothing entered
With Data1.Recordset
sBookMark = .Bookmark
.FindFirst "Country like '" + searchvar + "*'"
If .NoMatch Then ' record not found
MsgBox "No matching record"
.Bookmark = sBookMark
End If
End With
End If
End Sub
This code when the search button is fired flags the sBookMark = .Bookmark debug because the database hs no data, well enough.
Can you help me out here to enable the search button to fire an empty database and return No matching record. I dont know how to get rid of the .Bookmark function?
cheers
Paul Martins
How can i search a string inlcuding ' example 'John
hey im new in VB and i downlaoded your code, and i wonder if you could help me on my baby thesis.My problem is just how to edit the records on my database using a command button.Here is my first form:
http://i69.photobucket.com/albums/i70/lhouwhie/form1.gif
When i click the "Edit" button the following form loads:
http://i69.photobucket.com/albums/i70/lhouwhie/form2.gif
Then when o click on the "Save" button nothing happens, when i go back to the dirst form the records just stays the same.
Here's my code for the "Save" button (i haven't put trappings yet):
Private Sub cmdsave_Click()
Adodc1.Refresh
Adodc1.Recordset.Fields("Firstname") = txtfname.Text
Adodc1.Recordset.Fields("Lastname") = txtlname.Text
Adodc1.Recordset.Fields("Address") = txtaddress.Text
Adodc1.Recordset.Fields("ContactNumber") = txtcnum.Text
Adodc1.Recordset.Fields("Birthdate") = txtbirth.Text
Adodc1.Recordset.Fields("UserLevel") = cmblvl.Text
Adodc1.Recordset.Fields("Gender") = cmbgen.Text
Adodc1.Recordset.Update
Adodc1.Refresh
End Sub
thanks in advance and God Bless
This thread is for discussions of Basic ADODC Example.