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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating memo field gives "Invalid argument value" error

Status
Not open for further replies.

myatia

Programmer
Nov 21, 2002
232
I'm getting this message when I try to update a memo field in a recordset. If I remove the memo field lines from the update statement, the update works just fine. Does anyone have any advice? My code and error messages are below. Let me know if you have any questions.

Thanks,

Misty

ERROR MESSAGE
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Visual FoxPro Driver]Invalid argument value
/career/secure/career_guide/acguide_signup_demographics.asp, line 101


VALUES FROM THE FORM
FirmDesc = 'dfg'
Clind = 'dfgf'
Firmname = 'blah blah'


CODE
Code:
<%
'// Memo fields
FirmDesc = trim(Request.Form("FirmDesc"))
Clind = trim(Request.Form("Clind"))

'// text field
FirmName = trim(Request.Form("FirmName"))

set rs = server.createobject("ADODB.Recordset")
	
rs.cursorlocation = adUseServer
rs.cursortype = adOpenKeyset
rs.locktype = adLockOptimistic

fields = "firmother, clind, firmname"
st = "SELECT " & fields & " FROM guidedata WHERE id = " & id
rs.open  st, conn, , , adCmdText

rs("firmother") = FirmDesc
rs("clind") = Clind
rs("firmname") = FirmName
	
rs.Update  '<<== LINE 101
rs.close()
%>
 
instead of this;
rs.open st, conn, , , adCmdText

use;
rs.open st, conn, adOpenKeyset ,adLockOptimistic , adCmdText

as with having the empty parameters you will be setting the cursor and locktype to default.

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
I tried it using the code below, but got the same error on the same line. Do you have any other suggestions?

Code:
'Declare constants
Const adLockOptimistic = 3
Const adUseServer = 2
Const adCmdText = &H0001
Const adOpenKeyset = 1
	
set rs = server.createobject("ADODB.Recordset")

fields = "firmother, clind"
st = "SELECT " & fields & " FROM guidedata WHERE id = " & id
rs.open st, conn, adOpenKeyset, adLockOptimistic, adCmdText

rs("firmother") = FirmDesc
rs("clind") = Clind
	
rs.Update '<<== ERROR LINE
rs.close()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top