Passing parameters to access query, how?

Results 1 to 2 of 2

Thread: Passing parameters to access query, how?

  1. #1
    devilous Guest

    Default Passing parameters to access query, how?

    Hi<BR><BR>I&#039ve been working on an project that combines access97 db with asp.<BR>I&#039m trying to display the result of an access query based on a parameter which is sent from a form (the username) which is filled by the user.<BR>The result should be a list of dates the user visited on the site.<BR><BR>The Access Query named "ListByUser" and the table it queries is called "List". ListByUser quries the table List by the parameter sent to the Username field.<BR><BR>The form in the asp page returns the parameter called "un" which contains the username to be sent to the access query.<BR><BR>This is the asp code I&#039m using at the moment. ofcourse this code doesn&#039t sent the parameter to the query (that&#039s why I need you guys)<BR><BR>Set c=server.createobject("adodb.connection")<BR>c.ope n "dsn=mydb;"<BR>set r=server.createobject("adodb.recordset")<BR>r.acti veconnection=c<BR> "select * from ListByUser"<BR>do until r.eof<BR>response.write r.fields("visited_on") & "<BR>"<BR>r.movenext<BR>loop<BR><BR>So, my question is, where should I put the parameter ("un") to let access query by it.<BR>Ofcourse I could query the table directly from asp but I want to avoid this inorder to increase performance.<BR><BR>Thanks in advance<BR>Devilous

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing parameters to access query, how?

    hi,<BR> we cannot pass parameters to an access query .It is supported only in RDBMS. There we do it using an instance of command object only. If u find out that it can also be done to a access query, let us know.<BR><BR>sanjay

Posting Permissions

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