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
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
-
Can you describe Above simple VB6 code?
by pramodmca09 (0 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
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.