troubleshooting Question

VB.Net with Access 2007 - runing a query for a give search criteria

Avatar of José Perez
José PerezFlag for Chile asked on
Microsoft Access.NET ProgrammingVisual Basic.NET
42 Comments1 Solution576 ViewsLast Modified:
Hi,
I am working with vb.net 2012 an access 2007 database to develop a simple DMS (Document Management System).
I have resolved how to create new entries and update the database with all the document properties, including its original path.
Now, what I need to do is to create a second form where users can select some searching criteria and click the button for a custom result. The results has to be displayed in a 'user friendly' form, as much as possible, this means that additionally to the query, the user has to be able to click somewhere in the form so he can 'open' the selected document from the resulting list (using the 'original_path' property).

Initially I am trying to use a DataGridView control because it looks simple and allows me to preview the results but I dont know how to pass a new query from my search form to the 'result form' (the one that has de DataGridView control).

I am using DataGridView control but if someone tells me there is a better control or a better way to do it, I am open to acccept his or her answer if it works.

The following code is the one I am using to update the access database:
                dbProvider = "Provider=Microsoft.ACE.OLEDB.12.0;"
                Dim folderPath As String
                folderPath = My.Computer.FileSystem.CurrentDirectory
                Dim filePath As String
                filePath = "\main_db.accdb"
                dbSource = "Data Source=" & folderPath & filePath
                con.ConnectionString = dbProvider & dbSource
                con.Open()

                sql = "SELECT * FROM documents"
                da = New OleDb.OleDbDataAdapter(sql, con)
                da.Fill(ds, "documents")
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 42 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 42 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros