Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Trouble inserting form content into memo field


Message #1 by "James Lee" <jamesleemult@h...> on Tue, 25 Sep 2001 10:49:42
I'm having trouble storing a textarea form field ( Request.Form

("description") ) into a memo field ( objRS("downloaddescription")).



Below is the code i use;



~~~~~~~~~~~~~

	If Request.ServerVariables("CONTENT_LENGTH") > 0 THEN

	

	objRS.CursorLocation = adUseClient

	objRS.CursorType = adOpenKeyset

	objRS.LockType = adLockOptimistic	

	

	objRS.Open "SELECT *, downloadsize FROM downloads WHERE downloadid 

=" & strdownloadid

	

	objRS("downloadtitle") = CStr(Request.Form("downloadtitle"))



'Below is the line in question;

	objRS("downloaddescription") = CStr(Request.Form("description"))

'end line



	objRS("downloadsize") =  CStr(Request.Form("downloadsize"))



~~~~~~~~~~~





I get this error;



~~~~~~~~~~~~~~



Provider error '80040e21' 



Errors occurred 



~~~~~~~~~~~~~~~~~~~



Can you help?  

Thanks.
Message #2 by "Jim Losi" <jlosi1@t...> on Tue, 25 Sep 2001 09:40:46 -0400
Make sure your connection string is using the correct driver. Then you may

want to try a sql insert like this.

Dim SQL

Dim MyConn

Dim RS

Set MyConn = Server.CreateObject ("ADODB.Connection")

Set RS = Server.CreateObject ("ADODB.Recordset")

MyConn.Open "DSN or driver with location"



SQL="INSERT INTO tablename (fieldnamehere)Values('"&

request.form("variablename")&"' )"

Set RS=MyConn.execute(SQL)



Myconn.close

set myconn=Nothing









----- Original Message -----

From: "James Lee" <jamesleemult@h...>

To: "Access ASP" <access_asp@p...>

Sent: Tuesday, September 25, 2001 10:49 AM

Subject: [access_asp] Trouble inserting form content into memo field





> I'm having trouble storing a textarea form field ( Request.Form

> ("description") ) into a memo field ( objRS("downloaddescription")).

>

> Below is the code i use;

>

> ~~~~~~~~~~~~~

> If Request.ServerVariables("CONTENT_LENGTH") > 0 THEN

>

> objRS.CursorLocation = adUseClient

> objRS.CursorType = adOpenKeyset

> objRS.LockType = adLockOptimistic

>

> objRS.Open "SELECT *, downloadsize FROM downloads WHERE downloadid

> =" & strdownloadid

>

> objRS("downloadtitle") = CStr(Request.Form("downloadtitle"))

>

> 'Below is the line in question;

> objRS("downloaddescription") = CStr(Request.Form("description"))

> 'end line

>

> objRS("downloadsize") =  CStr(Request.Form("downloadsize"))

>

> ~~~~~~~~~~~

>

>

> I get this error;

>

> ~~~~~~~~~~~~~~

>

> Provider error '80040e21'

>

> Errors occurred

>

> ~~~~~~~~~~~~~~~~~~~

>

> Can you help?

> Thanks.




>

>




  Return to Index