[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

No value given for one or more required parameters.

Posted on 2004-11-18
12
Medium Priority
?
4,098 Views
Last Modified: 2012-08-14
Here we go :) - my programmer is gone so I am stuck.  I am getting this error:

No value given for one or more required parameters.

/classregistration/include/Query.asp, line 28


<%
class Query
      Private sqlString, comm, rs

      Private Sub Class_Initialize()
            Set comm = Server.CreateObject("ADODB.Command")
      End Sub
      
      Private Sub Class_Terminate()
            set rs = nothing
            set comm = nothing
      End Sub

      Public Property Let SQL(newValue)
            sqlString = newValue
      End Property

      public function Execute()
            Dim DBMan
            Set DBMan = new DBManager
    If DBMan.OpenDataBaseConnection() Then
      comm.ActiveConnection = DBMan.DB_Connection
      comm.CommandType = adCmdText
      comm.CommandText = sqlString
      comm.CommandTimeout = 0
      Set rs = Server.CreateObject("ADODB.Recordset")
      rs.CursorLocation = adUseClient
      rs.Open comm
    End If
            Set DBMan = Nothing
      end function

      Public Property Get Result()
            set Result = rs
      End Property
end class

Function ExecuteSQL(SQL)
      dim qry
      Set qry = new Query
      qry.SQL = SQL
      qry.Execute
      set ExecuteSQL = qry.Result
End Function

Function ExistsSQL(SQL)
      dim rs, qry
      Set qry = new Query
      qry.SQL = SQL
      qry.Execute
      ExistsSQL = not qry.Result.eof
End Function
%>

Line 28 is:
rs.Open comm
Now I am sure that it might not be pulling some of the information properly but I have no idea where to start / look.

Thanks!

-Corey
0
Comment
Question by:coreybryant
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 31

Accepted Solution

by:
alorentz earned 2000 total points
ID: 12620630
Where is this function being called - ExecuteSQL(SQL)

The SQL is what we need to see, and the table structured of the target table.
0
 
LVL 29

Author Comment

by:coreybryant
ID: 12620760
Is that from the previous page?  I mean - when I click on the link to get to the above page - this is the error.  

-Corey
0
 
LVL 29

Author Comment

by:coreybryant
ID: 12620790
Here is the previous page:
<!-- #include file="include/header.asp" -->
<%
CheckPermissionCMS(SITEOWNER)

dim op, sid, lid, id, rs, locationName, message, errmessage, all, monthid, sessid
op = Request.QueryString("op")
all = Request.QueryString("all")
id = Request.QueryString("id") 'member ID
sid = Request.QueryString("sid") 'session ID
lid = Request.QueryString("lid") 'location ID
monthid= Request.QueryString("monthid") 'month
sessid= Request.QueryString("sessionid") 'month
If op="delmonth" Then
      if not isNumeric(monthid) or monthid ="" then
            rw "Script error ... no month selected"
            re
      end if      
      DeleteMonth monthid ,lid ' month and location
      monthid=month(now)
      op=""
End if

If op="delsess" Then
      if not isNumeric(sessid) or sessid ="" then
            rw "Script error ... no session selected"
            re
      end if
      DeleteSession sessid ' session
'      monthid=month(now)
      op=""
End if


if not isNumeric(monthid) or monthid ="" then
      monthid=month(now)
end if
if not isNumeric(lid) or lid="" then
      lid = GetFirstLocationID
      if lid = 0 then
            rw "Please create a location first"
            re
      end if
end if

locationName = GetLocationDetail(lid).LocationName

if op = "reg" then
      if not isNumeric(id) or id = "" then
            rw "Invalid Member ID:" & id
            re
      end if      
      if not isNumeric(sid) or sid="" then
            rw "Invalid session ID"
            re
      end if
      RegisterSession sid, id
      rw "email: free slot for first waiting member"
      SendFreeSlotMessage id, sid
end if
            
'if op = "add" then
      'res = DeactivateSession(sid)
      'if res = errNoErrors then
            'message = "Session was successfully deactivated."
      'else
            'errmessage = msgUnknownErr
      'end if
'end if
'If all=0 Then
'      set rs = GetSessionList(lid)
'else
'      set rs = GetSessionListAll(lid)
'End if
      set rs = GetMonthSessionList(lid,monthid)

      %>
<br>
<script language="JavaScript">
      function confirm_session_delete(sessionid, name){
                  if (confirm ("Do you really want to delete the session  " + name)){
                        document.location = "sessionlist.asp?op=delsess&sessionID=" + sessionid + "&monthid=<%=monthid%>";
                        //document.frmSession.submit();
                        }
                  return false;
            }
      function confirm_month_delete(){
                  if (confirm ("Do you really want to delete the sessions for " + document.frmSession.monthid.options[document.frmSession.monthid.selectedIndex].text)){
                        location = "sessionlist.asp?lid=<%=lid%>&op=delmonth&monthID=" + document.frmSession.monthid.options[document.frmSession.monthid.selectedIndex].value;
                        }
                  return false;
            }
</script>
<form name="frmSession" action="sessionlist.asp" method="get">
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="lid" value="<%=lid%>">
<input type="hidden" name="op" value="<%=op%>">
<table class="formTable" cellpadding="5" cellspacing="0" border="0" align="center" width='80%'>
      <tr><td class="formTitle" colspan="2">Booking in <%=locationName%></td></tr>
      <%if message <> "" then%>
      <tr><td class="message" colspan="2"><%=message%></td></tr>
      <%elseif errmessage <> "" then%>
      <tr><td class="errmessage" colspan="2"><%=errmessage%></td></tr>
      <%end if%>
      <tr><td align="left" colspan="2">Show Booking for:</td></tr>
      <tr>
      <tr><td align="left"><select name="monthid"><%GenerateMonthCombo lid, monthid%></select>&nbsp;<input type="submit" name="month" value="Show">&nbsp;
            <input type="submit" name="deletepast" value="Delete old Sessions" onclick="return confirm_month_delete();">
      </td><td align="right"><a href="session.asp?op=add&lid=<%=lid%>">Add session</a>&nbsp;in&nbsp;<select name="locationID" onChange="javascript:document.location='sessionlist.asp?lid=' + document.frmSession.locationID.value;"><%GenerateLocationCombo(lid)%></select></td></tr>
      <tr>
            <td width="100%" colspan="2">
                  <table cellspacing="0" cellpadding="5" width="100%" border="0">
                        <tr class="tableHeader">
                              <td width="20%">Date</td>
                              <td width="8%">Start</td>
                              <td width="8%">End</td>
                              <td width="24%">Session Name</td>
                              <td width="10%">Status</td>
                              <td width="5%" align="right">Registered</td>                              
                              <td width="10%" align="right">Confirmed</td>
                              <td width="15%" align="right">Available</td>
                        </tr>
                        <%
                        dim i, oddRow, firstWaitID, firstWaitName, freeSlots, firstMember, regslots, confslots
                        i = 0
                        while not rs.EOF
                              i = 1 - i
                              if i = 0 then
                                    oddrow = "class=""highlight"""
                              else
                                    oddrow = ""
                              end if
                              confslots = GetMemberNumberByStatus(rs("SessionID"),"C")
                              regslots = GetMemberNumberByStatus(rs("SessionID"),"R") + confslots
                              freeSlots = rs("slot") - confslots'Session_GetFreeSlots(rs("SessionID")) - confslots
                              %>
                        <tr <%=oddrow%>>
                              <td><%=FormatDateTime(rs("SessionDate"),vbLongDate)%></td>
                              <td><%=rs("StartHour") & ":" & rs("StartMin") & " " & rs("StartSuffix")%></td>
                              <td><%=rs("EndHour") & ":" & rs("EndMin") & " " & rs("EndSuffix")%></td>
                              <td><a href="session.asp?sid=<%=rs("SessionID")%>" title="Edit session"><%=Encode(rs("SessionName"))%></a></td>
                              <td><%=rs("StatusName")%>&nbsp;<input class="redbutton" type="button" name="action" value="Delete" onClick="confirm_session_delete(<%=rs("sessionID")%>,'<%=rs("sessionname")%>');"></td>
                              <td align="right"><%=regslots%></td>
                              <td align="right"><%=iif(rs("MembersNo")=999,"none","<a href=""membersbysession.asp?sid=" & rs("SessionID") & """>" & rs("MembersNo") & "&nbsp;(view)</a>")%>
                              <td align="right"><%=freeslots%></td>
                        </tr>
                        <%rs.MoveNext
                        wend%>
                  </table>
            </td>
      </tr>
</table>
</form>
<!-- #include file="include/footer.asp" -->
-Corey
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 31

Expert Comment

by:alorentz
ID: 12620939
NO, ExecuteSQL is being called somewhere in the error page.
0
 
LVL 29

Author Comment

by:coreybryant
ID: 12620977
Wel here is the page that is being called:
<!-- #include file="include/header.asp" -->
<script language="JavaScript">
      function DoSubmit(op,sid,id) {
            document.frmMembersBySession.op.value = op;
            document.frmMembersBySession.id.value = id;
            document.frmMembersBySession.sid.value = sid;
            document.frmMembersBySession.submit();
      }
      function SaveNote(msid) {
            document.frmMembersBySession.msid.value = msid;
            document.frmMembersBySession.submit();
      }
      function ConfAll(id) {
            document.frmMembersBySession.id.value = id;
            document.frmMembersBySession.call.value = 'A';
            document.frmMembersBySession.submit();
      }
</script>
<%
'show members in a session
CheckPermissionCMS(SITEOWNER)

dim op, id, sid, rs, sessionName, message, errmessage, registeredNo, confirmedNo, action, actionmsg, totalNo
dim sessiondate, sessionhour, sessionminute, sessionsuffix, msid, note
if Request.Form("fromSubmit") <> "yes" then
      sid = Request.QueryString("sid") 'session ID
      if not isNumeric(sid) or sid="" then
            rw "Invalid session ID"
            re
      end if
else
      if Request.Form("msid") <> "" then                          
               msid = request.Form("msid")
            note = request.Form("comments" & msid)
            Call SaveNote(msid, note)
            response.redirect "membersbysession.asp?sid=" & request.Form("sid")
      end if
      If Request.Form("call") = "A" then
            ' confirm all
            dim callx, callxar, i
            sid = Request.Form("sid")
            If request.Form("callx") <> ""  Then
                  callx = request.Form("callx")
                  callxar = split(callx,",")
                  For i = 0 to Ubound(callxar)
                        ConfirmSession sid, callxar(i)
                  Next
            else
                  rw "!!! Nothing to Confirm!"
            End if
      end if            
      
      id = Request.Form("id")
      op = Request.Form("op")
      sid = Request.Form("sid")
      
      if op <> "" then
            if not isNumeric(id) or id = "" then
                  rw "Invalid Member ID:" & id
                  re
            end if      
            if not isNumeric(sid) or sid="" then
                  rw "Invalid session ID"
                  re
            end if
            if op = "C" then
                  ConfirmSession sid, id
            elseif op = "R" then
                  session("who")="A"
                  RegisterSession sid, id
            elseif op = "X" then
                  CancelSession sid, id
            elseif op = "L" then
                  LateCancelSession sid, id
            elseif op = "W" then
                  WaitSession sid, id
            end if
      end if
end if

sessionName = GetSessionDetail(sid).SessionName
sessionDate = GetSessionDetail(sid).SessionDate
sessionHour = GetSessionDetail(sid).StartHour
sessionMinute = GetSessionDetail(sid).StartMin
sessionSuffix = GetSessionDetail(sid).StartSuffix
confirmedNo = GetMemberNumberByStatus(sid, "C")
registeredNo = GetMemberNumberByStatus(sid, "R")
totalNo = confirmedNo + registeredNo
set rs = GetMemberListBySession(sid)
%>
<br>
<form name="frmMembersBySession" action="membersbysession.asp" method="post">
<input type="hidden" name="id" value="">
<input type="hidden" name="op" value="">
<input type="hidden" name="sid" value="<%=sid%>">
<input type="hidden" name="msid" value="">
<input type="hidden" name="call" value="">
<input type="hidden" name="fromSubmit" value="yes">
<table class="formTable" cellpadding="5" cellspacing="0" border="0" align="center" width='80%'>
      <tr><td class="formTitle">Members in <%=sessionName%>&nbsp(<%=formatdatetime(sessiondate,1)%>&nbsp<%=sessionhour%>:<%=sessionminute%> &nbsp<%=sessionsuffix%>)&nbsp;[<%=confirmedNo%> member<%=iif(CInt(confirmedNo)<>1,"s","")%> confirmed]</td></tr>
      <%if message <> "" then%>
      <tr><td class="message"><%=message%></td></tr>
      <%elseif errmessage <> "" then%>
      <tr><td class="errmessage"><%=errmessage%></td></tr>
      <%end if%>
      <tr><td>&nbsp;</td></tr>
      <tr><td align="right"><a href="memberadd.asp?sid=<%=sid%>">add member to session</a></td></tr>
      <tr>
            <td width="100%">
                  <table cellspacing="0" cellpadding="2" width="100%" border="0">
                        <tr class="tableHeader">
                              <td width="3%"></td>
                              <td width="10%">Name</td>
                              <td width="5%">Booking</td>
                              <td width="5%">Sess. left</td>
                              <td width="10%">Update</td>
                              <td width="10%">Status</td>
                              <td width="5%">Added By</td>
                              <td width="10%">Due</td>
                              <td width="20%">Note</td>
                              <td width="5%">&nbsp;</td>
                              <td width="15%" align="center">Action</td>
                        </tr>
                        <%
                        dim oddRow
                        i = 0
                        while not rs.EOF
                              action = AvailableActionsCMS(sid, totalNo, rs("StatusCode"), rs("memberID"), actionmsg)                              
                              i = 1 - i
                              if i = 0 then
                                    oddrow = "class=""highlight"""
                              else
                                    oddrow = ""
                              end if%>
                        <tr <%=oddrow%>>
                              <td><input type="checkbox" name="callx" value="<%=rs("memberID")%>" <%If rs("StatusCode")<>"R" or actionmsg="passed session" Then%>disabled<%
                              End if%>></td>
                              <td><a href="member.asp?id=<%=rs("memberID")%>"><%=Encode(rs("FirstName") & " " & rs("LastName"))%></a></td>
                              <td><a href="sessionsbymember.asp?id=<%=rs("memberID")%>">(view)</a></td>
                              <td><%=rs("SessionsLeft")%></td>
                              <td><%=FormatDateTime(rs("RegisterDate"),vbShortDate)%></td>
                              <td>
                                    <%=iif(rs("StatusCode")="C","<b>","")%><%=Encode(rs("StatusName"))%><%=iif(rs("StatusCode")="C","</b>","")%>
                                    <%if (action = "X" or action = "L") and rs("StatusCode") <> "C" then%>
                                          &nbsp;&nbsp;&nbsp;<input class="redbutton" type="button" name="action" value="Confirm" onClick="javascript:DoSubmit('C',<%=sid%>,<%=rs("memberID")%>);">
                                    <%end if%>
                              </td>
                              <td><%=rs("registeredby")%></td>
                              <td><%If rs("SessionsLeft")<=0 Then
                                    GetLastConfirmed rs("memberID")
                              else%>
                                    Unknown
                              <%End if%>
                              </td>
                              <td><textarea rows="2" cols="15" name="comments<%=rs("membersessionID")%>"><%=rs("Comments")%></textarea></td>
                              <td><input type="image" src="images/save.gif" value="savenote" alt="save comment" onClick="javascript:SaveNote(<%=rs("membersessionID")%>);">
                              </td>
                              <td>
                                    <%if actionmsg = "" then
                                          ActionLinkCMS action, sid, rs("memberID") ' id
                                    else
                                          rw actionmsg
                                          If actionmsg = "confirmed" Then
                                                rw vbCRLF
                                                ActionLinkCMS action, sid, rs("memberID") ' id                              
                                          End if
                                    end if%>
                              </td>                              
                        </tr>
                        <%rs.MoveNext
                        wend%>
                        <tr><td colspan=9>&nbsp;</td></tr>
                        <tr><td colspan=9><input type="button" class="button" value="Confirm all selected" onClick="javascript:ConfAll(<%=sid%>);"></td></tr>
                  </table>
            </td>
      </tr>
</table>
</form>
<!-- #include file="include/footer.asp" -->

(file name: membersbysession.asp?sid=524) - does that hopefully help?
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12621040
Well, this line rs.Open comm, is nowhere in that page, so you are giving the wrong information!
0
 
LVL 29

Author Comment

by:coreybryant
ID: 12621438
Well after looking more at the includes - I see the query.asp is actually included - but I am not certain what I am looking for..   Is ExecuteSQL exactly what I am looking for?

-Corey
0
 
LVL 11

Expert Comment

by:sciber_dude
ID: 12622166
you are looking for either a function or a sub with the name ExecuteSQL I guess. You need to find it on one of the page (probably one of the include pages) coz you didnt find it on the code you posted here.

:) SD
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 12622332
Sounds like you do not have an Entry in the Database for what you are trying to call.
i.e.
Search for "something"
And "something" is in the Table.Field = Things

"Something" is not actually in that Table.Field.

Do you follow me?

Check to make sure that the Data exist in the Table.Field before running the script.

I get this error All The Time. In the site that I am designing.

Info:

Database = Your have "Tables" in the Database.
Inside the Tables = Are "Fields"
You need to look through the Fields to make sure that everything that
You are wanting to retrieve, exist in the proper Fields.

Carrzkiss
0
 
LVL 29

Author Comment

by:coreybryant
ID: 12626011
The programmer finally got back about midnight & fixed this problem.  SD you were on the right track @ least & kept pointing me to the right stuff.

Thanks!

-Corey
0
 
LVL 11

Expert Comment

by:sciber_dude
ID: 12627899
@ coreybryant -

> SD you were on the right track
No! I just paraphrased what alorentz was saying! I think he deserves the credit!

:) SD
0
 
LVL 29

Author Comment

by:coreybryant
ID: 12627979
Sorry I only thought one person was talking - there was a lot of information here
-Corey
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question