Hello there
I have got a sp which take a datatype of @FaxDoc varbinary
Now I wanted to set the parameters from vba code the VBA Function as below
• Public Function SendFax(FaxNumber As String, RecipientName As String, Subject As String, faxDoc() As Byte)

Dim strConnection As String
Dim oDB As ADODB.Connection
Dim oCmd As ADODB.Command
strConnection = "Provider=SQLOLEDB.1;Data Source=" & DataSource & ";Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=" & DatabaseNameFax & ";Application Name=""Receipt Macro"""
Set oDB = New ADODB.Connection
oDB.Open strConnection
Set oCmd = New ADODB.Command
With oCmd
Set .ActiveConnection = oDB
.CommandType = adCmdStoredProc
.CommandText = "Sp_Faxinput"
.Parameters.Append .CreateParameter("@FaxNumber", adVarWChar, adParamInput, 100, FaxNumber)
.Parameters.Append .CreateParameter("@RecipientName", adVarWChar, adParamInput, 1000, "RecipientName ") 'Block and Slide Ids are private - not intended for the customer
.Parameters.Append .CreateParameter("@Subject", adVarWChar, adParamInput, 1000, "Subject")

.Parameters.Append .CreateParameter("@FaxDoc",advarByte, adParamInput, 10000, faxDoc)
.NamedParameters = True
.Execute
End With
Set oCmd = Nothing
End Function
I debug the code when it come to .Parameters.Append .CreateParameter("@FaxDoc",advarByte, adParamInput, 10000, faxDoc)
It through increate data type.
What is the right data type should use to pass a value of faxDoc() As Byte