Your idea works... but it only pulls one record at a time.
Any idea how i can pull all the records from the table?
Code:strSQL = "SELECT dbo.StoredDocument.Doc " _ & "FROM dbo.LetterQueue INNER JOIN " _ & "dbo.StoredDocument ON dbo.LetterQueue.DocID = dbo.StoredDocument.DocID " _ & "WHERE (dbo.LetterQueue.DatePrinted IS NULL)" OpenDataSet(dsData, strSQL, "MyImages") Dim x As String = dsData.Tables("MyImages").Rows.Count - 1 Dim i As Integer For i = 0 To x Dim myRow As DataRow myRow = dsData.Tables("MyImages").Rows(i) Dim MyData() As Byte MyData = myRow("Doc") Dim K As Long K = UBound(MyData) Dim fs As New FileStream _ ("C:\MyNewPDF.PDF", FileMode.Append, _ FileAccess.Write) fs.Write(MyData, 0, K) fs.Close() fs = Nothing Next Me.AxPdf1.Visible = True Me.AxPdf1.setCurrentPage(1) Me.AxPdf1.LoadFile("C:\MyNewPDF.PDF") Me.AxPdf1.gotoFirstPage() Me.AxPdf1.Enabled = True Me.AxPdf1.Select() Me.AxPdf1.Show()




Reply With Quote