I am making a project in visual basic about computer lab manegment.I also maked data base in ms access.i also connect it with forms.now, I want if i press 1 in form at run time,only the content of 1st row is show and other is hide.after it if I press 2 than the content of 2nd row in the data base is show and other is hide.how i can do this?
If your rows are being displayed or hidden on the form, the easiest way would be to use a filter on that part of the form. The filter would be based on the button being pushed; each button would invoke a different filter.
Make sure that the filter property of the form is ON.
- If you need clarification, ask it in the comment box above.
- Better answers use proper spelling and grammar.
- Provide details, support with references or personal experience.
Tell us some more! Your answer needs to include more details to help people.You can't post answers that contain an email address.Please enter a valid email address.The email address entered is already associated to an account.Login to postPlease use English characters only.
Tip: The max point reward for answering a question is 15.
If you want to save it in MS Access, you need an OLEDB Connection.
You need to declare few arguments first to accomplish your tast like, OLEDB Connection String, Connection, Data Adapter....
I'll write a simple program to show you. --------------------------------------------------------------------------- Const cn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "data source=path of Access file(2003) where you want to save input data.mdb;"
Dim conn As New oledb.OleDbConnection(cn)
Dim objda As New oledb.OleDbDataAdapter
Dim cmd as string = "insert into login (loginid,pass) values('" & TextBox1.Text & "')"
You will need to use a connection string. But - before you can configure the string correctly, I'd need to know how the data is stored (Access, SQL, ODBC, etc). You can find examples online. Just know that you are looking for "Connection String." Here's two examples:
1. For MS Access (Jet files):
' Set up the connection string.
m_strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strDestDBPath & ";" & _
"Jet OLEDB:Engine Type=5" ' NOTE: Use Type=5 for Jet 4.x.
Your code does not save in access format it just makes a copy of existing file. You need to open table by table and export data using csv format.
It can be done using access OLE to export, or
write some VB code to access the database tables via ODBC and save row data to csv file