Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Quotation syntax problem


Message #1 by "Spencer Saunders" <ssaunders@i...> on Sat, 4 Aug 2001 12:02:55 -0400
New to ASP and I can't seem to get the syntax with quotations quite 

right.



I am trying to dynamically pull data based on what the user selects from 

a form. The form is the first page and the second page takes the 

selection as a variable and uses that to pull a text file of the same 

name. - My problem is that I can't get the syntax right to include the 

variable in the <#-- include--> command.



Code as follows.



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

(page1.asp)



<form method=3D"get" action=3D"include.asp">

<Select name=3D"pick">





<%

Dim files



set files=3DServer.CreateObject("ADODB.recordset")

sqltext=3D"Select filename from articles"

files.open sqltext, "FileDSN=3Dspunki02.dsn"

files.Movefirst

Do While not files.EOF

response.write "<OPTION value=3D'" & files("filename") &".txt'>"

response.write  files("filename") & "</option>"

files.movenext

Loop

%>

</select><br>

<input type=3D"submit" value=3D"submit">

</form>

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D



(include.asp)

<%

set varpick =3D request.form("pick")

<!-- #include file=3D"../data/"& varpick &" -->

%>



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D





Sorry if this is a rather dumb question but I just don't know the 

syntax.



Thanks



spence



Message #2 by "Hans van Domselaar" <Hans.van.Domselaar@i...> on Mon, 6 Aug 2001 08:28:47 +0200
The #include command is interpreted during pre-compiling time.

That's why you can not use variables in this include-command because the

variable has no value at that time.



Greetings,

Hans van Domselaar (hans.van.domselaar@i...)

Web Developer Competence Center

Informaat BV, Baarn, The Netherlands

http://www.informaat.nl







-----Original Message-----

From: Spencer Saunders [mailto:ssaunders@i...]

Sent: zaterdag 4 augustus 2001 18:03

To: Access ASP

Subject: [access_asp] Quotation syntax problem





New to ASP and I can't seem to get the syntax with quotations quite

right.



I am trying to dynamically pull data based on what the user selects from

a form. The form is the first page and the second page takes the

selection as a variable and uses that to pull a text file of the same

name. - My problem is that I can't get the syntax right to include the

variable in the <#-- include--> command.



Code as follows.



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

(page1.asp)



<form method=3D"get" action=3D"include.asp">

<Select name=3D"pick">





<%

Dim files



set files=3DServer.CreateObject("ADODB.recordset")

sqltext=3D"Select filename from articles"

files.open sqltext, "FileDSN=3Dspunki02.dsn"

files.Movefirst

Do While not files.EOF

response.write "<OPTION value=3D'" & files("filename") &".txt'>"

response.write  files("filename") & "</option>"

files.movenext

Loop

%>

</select><br>

<input type=3D"submit" value=3D"submit">

</form>

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D



(include.asp)

<%

set varpick =3D request.form("pick")

<!-- #include file=3D"../data/"& varpick &" -->

%>



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D





Sorry if this is a rather dumb question but I just don't know the

syntax.



Thanks



spence




  Return to Index