Forum Moderators: open
Error Type:
Active Server Pages, ASP 0126 (0x80004005)
The include file haber_dosyasi was not found.
/anews/ozelhaberinfo.asp, line 253
<%
yol = "C:/1055/"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set dosya = objFSO.GetFolder("C:/1055/")
Set karmadosyalar = dosya.Files
For each dosyax in karmadosyalar
a= objFSO.GetBaseName(dosyax.name)
if a = rs("FILENAME") Then
haber_dosyasi = "yol & a & ".htm
%>
<!--#include file = "haber_dosyasi" -->
<%
End if
Next
%>
It looks like you're having two problems.
1. In this line:
<!--#include file = "haber_dosyasi" -->
<!--#include file = "<%= haber_dosyasi %>" -->
2. An include is read before ASP. That means you can't have an ASP variable for the name of the file you want to input. If I understand what you're trying to do, you'd need to check the string sent in rs("FILENAME"), and use if/then to see which file it referred to and serve that file, like:
<%
if rs("FILENAME") = "foo" then %>
<!--#include file="C:\1055\foo.htm" -->
<%
elseif rs("FILENAME") = "bar" then %>
<!--#include file="C:\1055\bar.htm" -->
<% else ... %>
Good luck,
g.