I’m trying to save a PDF File from ACCESS2010 to SQLserver2008.
I'm using the following code:
'using the Microsoft activeX Data Object 2.7
Set rs = New ADODB.Recordset
strSQL = "SELECT doc FROM ArquivoPDM"
rs.Open strSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Set mstream = New ADODB.Stream
mstream.Type = adTypeBinary
mstream.Open
mstream.LoadFromFile "C:\Desktop\PDM_Arquivos\doc.pdf"
rs.AddNew
rs.Fields("doc").Value = mstream.Read
rs.Update
rs.Close
mstream.Close
Set rs = Nothing
When I use the code the following error appears:
The data provider or other service returned a status E_Fail
Some type of help would be great.
Thanks’ to anyone who try helping.
rs.Update
rs.Close
mstream.Close
Set rs = Nothing
When I use the code the following error appears:
The data provider or other service returned a status E_Fail
Some type of help would be great.
Thank's to any one who try helping.
I'm using the following code:
'using the Microsoft activeX Data Object 2.7
Set rs = New ADODB.Recordset
strSQL = "SELECT doc FROM ArquivoPDM"
rs.Open strSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Set mstream = New ADODB.Stream
mstream.Type = adTypeBinary
mstream.Open
mstream.LoadFromFile "C:\Desktop\PDM_Arquivos\doc.pdf"
rs.AddNew
rs.Fields("doc").Value = mstream.Read
rs.Update
rs.Close
mstream.Close
Set rs = Nothing
When I use the code the following error appears:
The data provider or other service returned a status E_Fail
Some type of help would be great.
Thanks’ to anyone who try helping.
rs.Update
rs.Close
mstream.Close
Set rs = Nothing
When I use the code the following error appears:
The data provider or other service returned a status E_Fail
Some type of help would be great.
Thank's to any one who try helping.