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!

Updating a Recordset with an Image

Status
Not open for further replies.

SamHale

MIS
Mar 7, 2004
71
GB
Good afternoon,

Ok, I have a form that adds a record to my database. This record contains an image that gets entered as Binary Data. The code for this is:

Code:
Dim rs
	Set rs = Server.CreateObject("ADODB.Recordset")

	rs.Open "tbl_news", connStr, 2, 2

	' Adding data
	rs.AddNew
		rs("File Name") = fileName
		rs("File Size") = fileSize
		rs("File Data").AppendChunk fileData
		rs("Content Type") = contentType
		rs("name") = nameInput
		rs("details") = detailsInput
		rs("date") = dateInput
	rs.Update

rs.Close
Set rs = Nothing

Obviously shortened to keep this post down. However, what I cannot work out is how to update the recordset. I have tried a number of attempts, i.e. changing rs.add to rs.edit but I receive:

Code:
Object doesn't support this property or method: 'edit'

I also tried changing the rs.Open to include 'where ID=1' to try and edit the first recordset. But this still just adds a new record.

If anyone has any ideas they would be greatly apprechiated.

Kind regards
Sam
 
Sorry, think I may have added this to the wrong place. Ignore.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top