this is my code , it should save a pdf file from sql server to a folder but nothing happened can anyone help please ??
Set rs = New ADODB.Recordset
rs.Open "select * from PDFStore where filename='" & co_name.Text & "'", db, adOpenKeyset, adLockBatchOptimistic
If Not rs.EOF Then
Set pdffile = New ADODB.Stream
pdffile.Type = adTypeBinary
pdffile.Open
If IsNull(rs.Fields("Contents")) = False Then
pdffile.Write rs.Fields("Contents").Value
Dim pdfname As String
pdfname = co_name.Text
pdffile.SaveToFile "" & App.Path & "\report\" & pdfname & ".pdf", adSaveCreateOverWrite
pdffile.Close
Set pdffile = Nothing
Else
MsgBox "NO"
rs.Close
Set rs = Nothing
End If
End If