I am having Trouble coping an image type datafield from on table to another. I am using the following code but receive and error on the insert. I am user SQL Server 2000.
Any suggestions would be greatly appreciated.
Thanks
copysrccmd.CommandText = "SELECT * FROM tbl1 where fld1 = '" & LSTCLASS.List(idx) & "'"
copysrccmd.CommandType = adCmdText
Set copysrcrs = copysrccmd.Execute
Const conChunkSize = 100
VbQuote = Chr(34)
Dim ImgOffset As Long
Dim ImgLogoSize As Long
Dim varImg As Variant
Dim varChunk As Variant
Dim SQLString As String
ImgLogoSize = copysrcrs("Properties").ActualSize
Do While ImgOffset < ImgLogoSize
varChunk = copysrcrs("Properties").GetChunk (conChunkSize)
varImg = varImg & varChunk
ImgOffset = ImgOffset + conChunkSize
Loop
SQLString = "INSERT INTO tbl2 values ('" & copysrcrs.Fields(0).Value & "','" & _
copysrcrs.Fields(1).Value & "','" & varImg & "')"
copydestcmd.CommandText = SQLString
copydestcmd.CommandType = adCmdText
copydestcmd.Execute
Any suggestions would be greatly appreciated.
Thanks
copysrccmd.CommandText = "SELECT * FROM tbl1 where fld1 = '" & LSTCLASS.List(idx) & "'"
copysrccmd.CommandType = adCmdText
Set copysrcrs = copysrccmd.Execute
Const conChunkSize = 100
VbQuote = Chr(34)
Dim ImgOffset As Long
Dim ImgLogoSize As Long
Dim varImg As Variant
Dim varChunk As Variant
Dim SQLString As String
ImgLogoSize = copysrcrs("Properties").ActualSize
Do While ImgOffset < ImgLogoSize
varChunk = copysrcrs("Properties").GetChunk (conChunkSize)
varImg = varImg & varChunk
ImgOffset = ImgOffset + conChunkSize
Loop
SQLString = "INSERT INTO tbl2 values ('" & copysrcrs.Fields(0).Value & "','" & _
copysrcrs.Fields(1).Value & "','" & varImg & "')"
copydestcmd.CommandText = SQLString
copydestcmd.CommandType = adCmdText
copydestcmd.Execute