Skip to main content
Inspiring
October 11, 2006
Question

Simple update with ASP VBScript - Part 2

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


This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
October 12, 2006
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
Inspiring
October 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