;

ASP example drawing DB sem6




<%%@LANGUAGE = VBScript%%>
<%%
Option Explicit
Response.Expires = 0 %%>

<%%
Dim objConn, strConn, objRS, strfil, strQ, strout

Set objConn = Server.CreateObject("ADODB.connection")
StrConn = "Data Source=c2xx;User ID=;Password=;"
objConn.Open strConn
Set objRS = Server.CreateObject("ADODB.Recordset")
Set ObjRS.ActiveConnection = objConn
%%>

<%%
if Request.ServerVariables("CONTENT_LENGTH") <%%> 0 THEN
%%> 


<%%
strfil = Trim(Request.Form("fil"))
%%>
<%html%>
<%head%>
  <%title%>C201's tegningsdatabase<%/title%>
  <%meta name="description" content=""%>
  <%meta name="keywords" content=""%>
<%/head%>
<%body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#FF00FF"%>



<%%
strQ = " SELECT Filer.Filnavn "
strQ = strQ & " FROM Filer "
strQ = strQ & " WHERE Filer.Filnavn LIKE '"&strfil&"' "
strQ = strQ & " ORDER BY Filnavn "
Set objRS = objConn.Execute(StrQ)
%%>


<%%
'------- Hvis ingen data findes
if objRS.eof  then
Response.Write "INTET S_GERESULTAT"
Response.Write "<%br%><%br%><%a href='c201.asp'%>Tilbage<%/a%>"
else
%%>
S°geresultat:<%br%>

<%%
While Not(objRS.EOF)
strout = "<%a href=http://" & objRS ("Filnavn") & " %>" & objRS ("Filnavn")& " <%/a%>"
Response.Write(strout) & "<%br%>" 
objRS.Movenext
Wend

%%>
<%/body%>
<%/html%>

<%%
end if
else
%%>

<%html%>
<%head%>
  <%title%>C201's tegningsdatabase<%/title%>
  <%meta name="description" content=""%>
  <%meta name="keywords" content=""%>
<%/head%>
<%body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#FF00FF"%>

<%!-- Start of FORM --%>
<%form method="POST" action="c2xx.asp"%>
<%h2%>C201<%/h2%><%br%>
S°g p_ filnavn, brug % som wildcard<%br%><%br%>
<%input type="text" name="fil" value=""%><%br%>
<%input type="submit"%><%input type="reset"%>

<%/form%>
<%!-- End of FORM --%>


<%/body%>
<%/html%>








<%%
End if%%>
<%%
' Luk databaseforbindelse
'objRS.Close
objConn.Close
Set objRS = Nothing 
Set objConn = Nothing
%%>