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

Simple update with ASP VBScript - Part 2

LEGEND ,
Oct 11, 2006 Oct 11, 2006
Sorry the post send before I could paste the code in...

I have this working on other pages, running on the same server, but can I
get this to work...

I have an access datadabse with a Yes/No field, I am trying to run the code
belwo to update this to a Yes with teh following -

<%
Dim rsFrancUsers__MMColParam
rsFrancUsers__MMColParam = "1"
If (Request.QueryString("id") <> "") Then
rsFrancUsers__MMColParam = Request.QueryString("id")
End If
%>
<%
Dim rsFrancUsers
Dim rsFrancUsers_numRows

Set rsFrancUsers = Server.CreateObject("ADODB.Recordset")
rsFrancUsers.ActiveConnection = MM_cMiniJumps_STRING
rsFrancUsers.Source = "SELECT * FROM postapony WHERE id = " +
Replace(rsFrancUsers__MMColParam, "'", "''") + ""
rsFrancUsers.CursorType = 0
rsFrancUsers.CursorLocation = 2
rsFrancUsers.LockType = 2
rsFrancUsers.Open()

rsFrancUsers_numRows = 0
%>
<%
rsFrancUsers("mjauth") = True
rsFrancUsers.Update
%>

and I get the following error -


Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 13.

/admin/pp-authorise.asp, line 27 (This refers to the rsFrancUsers.Update
command)



Any ideas would be appreciated

Thanks


TOPICS
Server side applications
277
Translate
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 ,
Oct 12, 2006 Oct 12, 2006
Try changing the recordset cursor type to a dynamic cursor (you are on read
only at the moment)

rsFrancUsers.CursorType = 0

Becomes

rsFrancUsers.CursorType = 3

HTH
Rob
http://robgt.com/ [Tutorials and Extensions]
Firebox stuff: http://robgt.com/firebox
Skype stuff: http://robgt.com/skype
SatNav stuff: http://robgt.com/satnav


Translate
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 ,
Oct 12, 2006 Oct 12, 2006
LATEST
Also - if you're updating a Yes/No field in Access, Yes = -1 and No = 0.

So:
rsFrancUsers("mjauth") = "-1"
rsFrancUsers.Update

Might work?
Cheers,
Rob
http://robgt.com/ [Tutorials and Extensions]
Firebox stuff: http://robgt.com/firebox
Skype stuff: http://robgt.com/skype
SatNav stuff: http://robgt.com/satnav


Translate
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