Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading SSI file from Access database

Status
Not open for further replies.

DanyelHolmes

Programmer
Dec 29, 2002
3
US
I'm trying to develop a page where I'm listing fields from an Access database. I'm trying to make one of these fields a Server Side Include (SSI) where the file name being called is located in the Access database.

The field in the Access database has the following attributes:

fieldname: SSI
fieldtype: text

One of the values of this field is: "SSI_WWYAMC.htm"

The code I tried to use in my page is as follows:

<td><!-- #include file=<% response.write(rsInv(&quot;SSI&quot;))%>></td>


Can someone help me with this or let me know if this is possible?

Danyel
 
try adding &quot; &quot; around the var
<td><!-- #include file=&quot;<% response.write(rsInv(&quot;SSI&quot;))%>&quot;></td>

---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
Unfortunatly you can't dynamically include files like this. The includes are processed before the actual script is, so that any script inside include files can be added in ahead of time. Since the includes are process first, it is not going to be able to load the filename that you are writing after the includes have been processed.

-Tarwn Experts are only people who have realized how much they will never know about a language.
________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
good call tarwn
so how about a solution possibly
as you see my limited knowledge of using includes due to using server.execute in place many times (although not entirely thte same) you get the same effect
so here's what I'm thinking [wink]
please someone step in if I am wrong as this is a idea

<%
dim Incfile
Incfile = rsInv(&quot;SSI&quot;)
%>
<td><% server.execute Incfile %></td>

hmm. not sure if the server.execute will recognize the variable as such so I'm off to try it [smile]
---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
I found a solution. I change the field &quot;SSI&quot; to a memo field and inserted the code from the SSI file directly into this field. From my page I removed the include statement and called the SSI field and it returned the correct results.

My code now looks like this:

<td><% response.write(rsInv(&quot;SSI&quot;)) %></td>

Thanks to everyone who responded.

Danyel
 
Hmm, I could see how this would work fine with HTML code, but I don't think it's going to execute ASP script if your writing it from the db field like that, any luck with your execute onpnt?

(nice logo change btw, noticed it earlier when I was showing a customer your site)

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
the execute worked fine without any problems.
I was slightly supprised, I've never tried to use it in this way but I couldn't think of a reason for it not too.


I like the site more now too. thanks. I love CSS, if you don't like the color of something you just change a few things and there you have it. :) ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
To bad it doesn't work for cars ;)
Tarwn.ObjectCollection.automobile.style.color = &quot;#000000&quot;;

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top