2) click on search button - all details of chemical appear in respective places
3) next, i would require a link label to be clicked on to bring me to the specified chemical file because each chemical has its own special file
Its like each time I search for chemical A, the link label will show chemical A's file upon clicking it.
and if I were to search another chemical, chemical B,the link label will show chemical B's file upon clicking it.
Problem: i'm figuring out how to connect my linklabel to open the specified chemical's file link which is stored in ms access.
In my access table, I have a table with two columns;
1st column: All chemical Names
2nd Column: Contains all the links to the chemical files that i want to open in the task above.
Code I have done so far which is left hanging coz, I don't know how to modify it,
Expand|Select|Wrap|Line Numbers
- Public Function linktoMSDS(ByVal Link_To_MSDS As String)
- Dim strSql As String
- Dim dstemp As New DataSet
- Try
- build()
- strSql = "Select [Link to MSDS] from tblChemical where [Link To MSDS] = '" & Link_to_MSDS & "'"
- myCommand = New OdbcCommand(strSql, myConn)
- myCommand.CommandTimeout = 50
- myAdapter = New OdbcDataAdapter
- myAdapter.SelectCommand = myCommand
- connect()
- myAdapter.Fill(dstemp, "tblChemical")
- Return dstemp
- Catch ex As Exception
- Try
- Catch odbcEx As OdbcException
- MessageBox.Show(odbcEx.Message & odbcEx.StackTrace)
- End Try
- MessageBox.Show(ex.Message, ex.StackTrace)
- Return dstemp
- Finally
- disconnect()
- End Try
- End Function
Expand|Select|Wrap|Line Numbers
- Dim dsChemical As New DataSet
- dsChemical = New DataSet
- Dim strlink_to_MSDS As String
- Dim i As Integer
- If dsChemical.Tables("tblchemical").Rows.Count > 0 Then
- If txtchemname.Text = dsChemical.Tables(0).Rows(0)("Chemical Name") Then
- For i = 0 To dsChemical.Tables(0).Rows.Count - 1
- strlink_to_MSDS = dsChemical.Tables(0).Rows(0)(4)("Link to MSDS")
- Next
- End If
- End If
- End Sub