Print ms access data in vb.net

Posted by user225269 on Stack Overflow See other posts from Stack Overflow or by user225269
Published on 2010-03-08T11:28:08Z Indexed on 2010/03/08 11:36 UTC
Read the original article Hit count: 332

Filed under:
|

How do I print the ms access data(.mdb) in vb.net? Here is the code that I'm using to view the data in the form. What I want to do is to be able to print what is currently being viewed. Perhaps automatically save the .pdf file and the pdf viewer installed on the system will open that newly generated pdf file

Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\search.mdb")
            Dim cmd As OleDbCommand = New OleDbCommand("Select * from GH where NAME= '" & TextBox6.Text & "' ", cn)

            cn.Open()

            Dim rdr As OleDbDataReader
            rdr = cmd.ExecuteReader




            If rdr.HasRows Then
                rdr.Read()
                NoAcc = rdr("NAME")
                If (TextBox6.Text = NoAcc) Then TextBox1.Text = rdr("IDNUMBER")
                If (TextBox6.Text = NoAcc) Then TextBox7.Text = rdr("DEPARTMENT")
                If (TextBox6.Text = NoAcc) Then TextBox8.Text = rdr("COURSE")

            End If

-some sites for beginners regarding this topic would help a lot:)

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about ms-access