Help using request.servervariables("Query_String")

Results 1 to 3 of 3

Thread: Help using request.servervariables("Query_String")

  1. #1
    Dennis Franczak Guest

    Default Help using request.servervariables("Query_String")

    I&#039m trying to get information about a Project from an Access 97 database. The user picks the project by clicking on a hyperlink on another page. The code to open the database is as follows:<BR>(I put response.write in so I could see that it takes the right number, which it does. I want projnum to be the index of the record to be pulled from the database (i.e --I want Project 58 information<BR>&#060;% <BR>projnum= request.servervariables("query_string")<BR>respons e.write "Project Number is " & projnum & "<BR>"<BR>Set OBJdbConnection = Server.CreateObject("ADODB.Connection") <BR>OBJdbConnection.Open "IT Projects" <BR>SQLQuery = "SELECT * FROM Task_Table1 WHERE(((Task_Table1.[PR#])= projnum))" <BR> Set Project = OBJdbConnection.Execute(SQLQuery)<BR> %&#062;<BR><BR>The output is as follows:<BR><BR>Project Number is 58<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e10&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. <BR><BR>/bcprojectweb/projectdetail3.asp, line 21

  2. #2
    Join Date
    Dec 1969

    Default RE: Help using request.servervariables(

    Try the following:<BR>1st change the name of the database file to something without a space in it (ie. ITProjects )<BR>2nd change you database connection script to and SQL Query to:<BR><BR>DBPATH = Server.MapPath("ITProjects")<BR>ConnectString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & DBPATH<BR> <BR>Set OBJdbConnection = Server.CreateObject ("ADODB.Connection")<BR>OBJdbConnection.Open ConnectString<BR><BR>SQLQuery = "SELECT * FROM Task_Table1 WHERE Task_Table1.[PR#]=" & projnum<BR>Set ProjectRS = OBJdbConnection.Execute(SQLQuery)<BR><BR>This should fix it, assuming the Task_Table1.[PR#] portion of the query is alright.<BR><BR>Grant D. Skinner<BR>Director,

  3. #3
    Dennis Franczak Guest

    Default RE: Help using request.servervariables(

    That did it. Thanks Grant!

Posting Permissions

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