No value given

Results 1 to 3 of 3

Thread: No value given

  1. #1
    Join Date
    Dec 1969

    Default No value given

    Well folks, I&#039;ve got a little bit of experience with ASP under my belt (about four days now), but I&#039;m hung up on this problem.<BR><BR>I am trying to create a generic listing page and specify the WHERE clause via the a URL query string.<BR><BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>strDBPa th = Server.MapPath("netequip.mdb")<BR>objConn.Open = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & strDBPath<BR><BR>Set objRS = Server.CreateObject("ADODB.RecordSet")<BR><BR>strS QL = "SELECT * FROM Servers WHERE " & Request.QueryString("LB") & " = " & Request.QueryString("VN")<BR>objRS.Open strSQL, objConn<BR><BR>The LB stands for "List By" which would be the field name. VN stands for "Variable Name" which would be the value within a field. For instance, I am listing servers on this page. One of the fields is "Dom" (for Domain). A server could either be in the "LIQWID" domain or the "DREAM" domain. I would like to be able to enter `list.asp?LB=Dom&VN=LIQWID` and return all the servers in that particular domain. BUT, when I excute the script, I am receiving the following:<BR><BR>Error Type:<BR>Microsoft JET Database Engine (0x80040E10)<BR>No value given for one or more required parameters.<BR><BR>The coding at the beginning of this message is basically all there is, aside from some If statements to verify the URL variables exist.<BR><BR>huff huff huff(catching my breath)<BR><BR>Any ideas?

  2. #2
    Join Date
    Dec 1969

    Default Debug it

    strSQL = "SELECT * FROM Servers WHERE " & Request.QueryString("LB") & " = " & Request.QueryString("VN")<BR><BR>Response.Write strSQL<BR><BR><BR>objRS.Open strSQL, objConn<BR><BR><BR>But just off hand I would say that you are missing single quotes around the second part.<BR><BR>Also doing it the way you are trying is risky. Read this:<BR>

  3. #3
    Join Date
    Dec 1969

    Default Chris is right...

    If you put in the RESPONSE.WRITE to debug it you might see your mistakes (yes, plural) immediately.<BR><BR>But maybe not, if you don&#039;t understand the SQL language.<BR><BR>So what the heck, some help:<BR><BR>strSQL = "SELECT * FROM Servers " _<BR> & " WHERE LB=&#039;" & Request.QueryString("LB") & "&#039; " _<BR> & " AND VN=&#039;" & Request.QueryString("VN") & "&#039; "<BR>Response.Write "DEBUG: SQL is " & strSQL & "&#060;HR&#062;" & vbNewLine<BR>objRS.Open strSQL, objConn<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