I have a column named IMGDATA of type Image in my MyImages in SQL Server server I have a string variable named MyImageStringBase64Encoded that contains a base64 encoded image. I m trying to save this image to the database
Set Command1 = Server.CreateObject ("ADODB.Command")
Command1.ActiveConnection = MyConnection_STRING
Command1.CommandText = "INSERT INTO MyImages (IMGNAME,IMGDATA) VALUES (?,?)"
Command1.Parameters(0) = "My Image Name"
Command1.Parameters(1) = MyImageStringBase64Encoded
Command1.CommandType = 1
Command1.Execute()
The code above will save corrupted image data in the db. Maybe I have to save bytes?
possibly related but not sure how to apply them
https://stackoverflow.com/a/24925145/934967
MS Access: Sending image as varbinary to stored procedure
I 'm new to vbscript