
Saving Binary files on the Client to the Image data type in SQL Server
Hi
I have a binary file that is in a variant type variable. I need to place
this file in an image data type in SQL Server. The file is always less than
64kB in size .
How do I convert the file to a string (which can then be placed in an SQL
statement and passed to a stored procedure in SQL Server using a pass
through query).
I have been unsuccessful using the following function:
Public Function BinaryToString(varBinData As Variant) As String
Dim intColumn As Integer
Dim strTemp As String
strTemp = "0x"
For intColumn = 1 To 16
strTemp = strTemp & _
Right$("00" & Hex(AscB(MidB(varBinData, intColumn, 1))), 2)
Next intColumn
BinaryToString = strTemp
End Function
Thank you
Martin Fine
Sydney Australia