<code>databas
<FORM name="search1" action="search1.asp" method="post">
----------------------------------------------------------------------------
If Request.Form("search1")<>"" Then
set dbconn = Server.CreateObject("ADODB.Connection")
dbconn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=pic_db;Data Source=UBORG206"
Set RecSet = Server.CreateObject("ADODB.Recordset")
Tafram = "SELECT * FROM image_tbl"
RecSet.Open Tafram ,dbconn,3,2,1
if RecSet("word")<>"" then
RecSet.MoveFirst
do until RecSet.EOF
text = RecSet("word")
findthis = Request.Form("search1")
result = InStr(text,findthis)
'Response.Write(result)
RecSet.MoveNext
if result<>"0" then
x = 1
Response.Write(RecSet("seek"))
y = RecSet("seek")
%><SCRIPT>
parent.main1.disp('<%=y%>');
</SCRIPT><%
end if
loop
end if
if x <> 1 then
Response.Write("Tyvärr hittades ingen bild.")
end if
End if
%>
när jag kör denna HÄNDER INGET! inga fel mezz alls HJÄLP!!Sv: databas
Function SQLText(Value)
If Len(Value) > 0 Then
SQLText = "'" & Replace(SQLText, "'", "''") & "'"
Else
SQLText = "Null"
End If
End Function
If Len(Request.Form("search1"))>0 Then
set dbconn = Server.CreateObject("ADODB.Connection")
dbconn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=pic_db;Data Source=UBORG206"
Set RecSet = Server.CreateObject("ADODB.Recordset")
Tafram = "SELECT * FROM image_tbl WHERE InStr(word, " & SQLText(Request.Form("search1")) & ")>0"
RecSet.Open Tafram, dbconn
If RecSet.EOF Then
Response.Write("Tyvärr hittades ingen bild.")
Else
Response.Write(RecSet("seek"))
%><SCRIPT>parent.main1.disp('<%=RecSet("seek")%>');</SCRIPT><%
End If
%>
</code>