another function problem

Results 1 to 2 of 2

Thread: another function problem

  1. #1
    Join Date
    Dec 1969

    Default another function problem

    Here is my function that calls a stored procedure that accepts a m_id and a city value:<BR><BR>Function getLocations(ByVal city, ByVal province)<BR>Const adInteger = 3<BR>Const adVarChar = 200<BR>Const adParamInput = &H0001<BR>Const adParamOutput = &H0002<BR>Const adParamReturnValue = &H0004<BR>Set rs = Server.CreateObject("ADODB.RecordSet")<BR>cmdTemp. CommandType = adCmdStoredProc <BR>cmdTemp.CommandText = "test"<BR>cmdTemp.Parameters.Append cmdTemp.CreateParameter("@city", adVarChar, adParamInput, 40, city)<BR>cmdTemp.Parameters.Append cmdTemp.CreateParameter("@m_id", adInteger, adParamInput, 3, m_id)<BR><BR>cmdTemp.CommandTimeout = 60 &#039; timeout in one minutes<BR>Set rs = cmdTemp.Execute<BR>Set getLocations = rs<BR>End Function<BR><BR>This is how i call the function in another page:<BR>&#060;% <BR> city = request.form("txt_city") <BR> m_id = request.querystring("id") <BR> set rsLocation = getLocations(city, m_id) <BR> do while not rsLocation.eof<BR> %&#062;<BR>Error:<BR>&#039;test&#039; expects parameter &#039;@m_id&#039;, which was not supplied. I did a response.wrtie(m_id) and it does hold the value passed

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Did we not do this yesterday

    &#062;set rsLocation = getLocations(city, m_id) <BR>make sure m_id has a MAY be blank as in an empty string<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts