Forum Moderators: open

Message Too Old, No Replies

Update SQL "image" field

Trying to write a large amount of text to an MSSQL "image" field

         

comfused

8:50 am on Jun 22, 2004 (gmt 0)

10+ Year Member



Hi all,

I'm trying to write a large amount of text to an MSSQL "image" field.

I didn't design the database and so am unable to simply change the field type.

Any ideas how I can submit a large quantity of text (possibly more than 8,000 characters) from an html form to update this field?

Thanks in advance!

tomda

9:35 am on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you can not change the field type, then it will be difficult. I do not know the image field of MSSQL (as I use MySQL), so I really can not help you much.

Can't it work using include (so that you do not interfere with the db)?
1/ GET the id of the row
2/ Call the include ($called_inc = "include".$id.".php";)
3/ Create your include file in php with $text="blah blah..."
4/ And call the text variable from the include.

comfused

10:33 am on Jun 22, 2004 (gmt 0)

10+ Year Member



Thanks for the suggestion Tomda.

Perhaps I should explain a little more about the situation.

The MSSQL database is used by an expensive CRM package that was bought by our company before I joined. This package is in daily use by all companies throughout the group - this is why I can't change the field type and also why I can't store data outside the DB.

I've written a forecast tool that reports the likely order intake up to 12 months into the future and takes it's information from the same MSSQL database that the CRM package uses. Part of this involves allowing the user to quickly adjust the Probability, Forecast Period and Project Notes without having to open the CRM package, find the project..etc..etc..

It's the project notes that occupy the "image" field and these can be pretty big as they document some projects over several years.

I need to figure out some way of allowing the user to add their note to the existing project notes and save them in the MSSQL database. I currently have a HTML form that uses a SQL UPDATE statement to add the posted form results to the database but as I'm updating an "image" field, this method isn't working.

I'm guessing I need to convert the text in the HTML form to binary or hex in order to update the field?

I'm using ASP but could use ASP.NET if it's more appropriate.

Thanks!