Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Image into Access DB

Status
Not open for further replies.

mchoudhury

Programmer
Nov 26, 2004
71
GB
Hi Guys,
I'm trying to insert a image into an Access DB, but having bit of a problem sorting the backend codeing. Can someone look at it and tell me how would i amend this inorder to accept image:

Dim PictureCommand As OleDbCommand

Dim InsertBye As Byte = "INSERT INTO Properties ([Picture1]) Values (@Picture1)"

PictureCommand = New OleDbCommand(InsertBye, MyConnection)

PictureCommand.Parameters.Add(New OleDbParameter("@Picture1", OleDbType.VarBinary, 150))
PictureCommand.Parameters("@Picture1").Value = Server.HtmlEncode(Picture1.FileName)

If this is wrong coding, can someone kindly write me a script where images would be inserted into an access DB

Thank You,
Mac
 
I had a look at the site, did not really help me as i could not transfer the script in to my coding. C# is not a strong skills of mine. Any other idea
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top