Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Update without form using ASP

New Here ,
Aug 04, 2009 Aug 04, 2009

Copy link to clipboard

Copied

Hi, I am able to update records with forms. I now need to update records without the use of forms but keep getting stuck. Your help is very much appreciated. I don't think dreamweaver supports this, so I started adapting my code as as follows:

<%
Dim rsRespondents
Dim rsRespondents_numRows
Set rsRespondents = Server.CreateObject("ADODB.Recordset")
rsRespondents.ActiveConnection = MM_CHRdsn_STRING
rsRespondents.Update="SurveyEmployees SET FirstName='Changed' WHERE EmployeeID='17'"
rsRespondents.CursorType = 0
rsRespondents.CursorLocation = 2
rsRespondents.LockType = 1
rsRespondents.Open()
rsRespondents_numRows = 0
rsRespondents.Connection.Execute
%>

I get the following error:
ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/chr_cms/CHROTupdatewithoutform1.asp, line 19 <-- this is the line starting with rsRespondents.Update

I have also used rsRespondents.Update="UPDATE SurveyEmployees .......

but same error message

What am I doing wrong here ?

[Thread moved by moderator to correct forum]

TOPICS
Server side applications

Views

647
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 04, 2009 Aug 04, 2009

Copy link to clipboard

Copied

I've never seen the update method used that way - are you sure it's valid?  Typically, you would select the record you want to modify into the recordset, change it, and then call the update method. Or, you can specify the fields and values you want to update as arguments to the method. But I've never seen it include an actual update statement.

http://msdn.microsoft.com/en-us/library/ms676529(VS.85).aspx

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 05, 2009 Aug 05, 2009

Copy link to clipboard

Copied

LATEST

Many thanks  for your quick and helpfull reply !

As I struggled for a moment with an error message referring to the wrong locktype I changed the dreamweaver default locktype from 1 to 2

it worked.

Any implications on changing the locktype that I should be aware of ?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines