Jeg skal ha trukket nick der begyder med tegn ud af databasen i
dette script...... nogen der her en ide til hvordan.... hvad skal
value være = på den sidste knap... lige nu er den 0-9 og det
virker ikke...
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=" &
Server.MapPath("Database.mdb") & ""
SQL = "Select * From Billeder where nick like '" &
request.form("qrt") & "%'"
Set RS = DataConn.Execute(SQL)
If (RS.EOF Or RS.BOF) = "" Then
Response.Write"Der er ingen billeder i databasen."
Else
' *************** Gennemløb Recordset (rs) med en løkke
******************
Dim strlink, ItemCounter, kol, wide, strvalg
kol = 4 'Antalet af kolloner
ItemCounter = 0
wide = 25
Response.Write "<Center><table border=""1"" align=""center""
width=""100%"">"
Response.Write "<tr>"
Do
' *************** laver et link til andre.asp med Id-værdien
i URL
**************************
strLink = "<img src=""vis_billede.asp?id=" & rs("id") & """
width=""146""
height=""142""></a>"
strvalg = "<a href='valg.asp'></a>"
' *************** Liste med links ******************
Response.Write "<td align=""center"" width="" " &
CInt(100/kol) & "%""> " &
strLink & "<br><p align=""left"">" & "Nick: " & "" & rs("nick") &
"<br><p align=""left"">" &
"Irl: " & "" & rs("irl") & "</td>"
' *************** Gå til næste Record i rs
******************
rs.MoveNext
'******* Skift line for hver 4. link *******************
If (ItemCounter Mod kol) = (kol-1) Then
response.write "</tr></table><br><table border=""1""
align=""center"" width=""100%""><tr>"
End If
ItemCounter=ItemCounter+1
'if wide = 100 then wide = 0
'end if
'wide = wide+25
' *************** Fortsæt indtil rs er gennemløbet (EOF = End Of
File)
*****************
Loop While Not rs.EOF
'********* Afslutter tabel ***************
Response.Write "</tr></table></center>"
<!--#include virtual=/wwwroot/valg.asp-->
end if
response.write "<div align=""center""><center><table border=""1""
width=""100%""><tr><td
width=""25%"" align=""center"" valign=""middle""
height=""30""><form method=""post""
action=""se.asp""><input class=knap type=""submit"" value=""a""
Name=""qrt""
valign=""middle""><input class=knap type=""submit"" value=""b""
name=""qrt""><input
class=knap type=""submit"" value=""c"" name=""qrt""><input
class=knap type=""submit""
value=""d"" name=""qrt""><input class=knap type=""submit""
value=""e"" name=""qrt""><input
class=knap type=""submit"" value=""f"" name=""qrt""><input
class=knap type=""submit""
value=""g"" name=""qrt""><input class=knap type=""submit""
value=""h"" name=""qrt""><input
class=knap type=""submit"" value=""i"" name=""qrt""><input
class=knap type=""submit""
value=""j"" name=""qrt""><input class=knap type=""submit""
value=""k"" name=""qrt""><input
class=knap type=""submit"" value=""l"" name=""qrt""><input
class=knap type=""submit""
value=""m"" name=""qrt""><input class=knap type=""submit""
value=""n"" name=""qrt""><input
class=knap type=""submit"" value=""o"" name=""qrt""><input
class=knap type=""submit""
value=""p"" name=""qrt""><input class=knap type=""submit""
value=""q"" name=""qrt""><input
class=knap type=""submit"" value=""r"" name=""qrt""><input
class=knap type=""submit""
value=""s"" name=""qrt""><input class=knap type=""submit""
value=""t"" name=""qrt""><input
class=knap type=""submit"" value=""u"" name=""qrt""><input
class=knap type=""submit""
value=""v"" name=""qrt""><input class=knap type=""submit""
value=""x"" name=""qrt""><input
class=knap type=""submit"" value=""y"" name=""qrt""><input
class=knap type=""submit""
value=""z"" name=""qrt""><input class=knap type=""submit""
value=""æ"" name=""qrt""><input
class=knap type=""submit"" value=""ø"" name=""qrt""><input
class=knap type=""submit""
value=""å"" name=""qrt""><input class=knap type=""submit""
value=""0-9""
name=""qrt""></form></td></tr></table></center></div>"
RS.Close
Set RS = Nothing
DataConn.Close
Set DataConn = Nothing
--
Vil du lære at kode HTML, XHTML, CSS, SSI eller ASP ???
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials