05. januar 2002 - 21:23
Der er
18 kommentarer og 1 løsning
Hjælp behøves lige nu....
jeg få kun halvdelen af database indholdet trukket ud med følgende... Nugen som kan sige mig hvordan det skal se ud for jeg får det hele... <% Response.Cookies(\"tgDate\") = now()%> <body topmargin=\"0\" leftmargin=\"0\"> <center> <% Conn_String = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"link.mdb\") Set Conn=Server.CreateObject(\"ADODB.Connection\") Conn.Open Conn_String sql = \"select * from cat order by cat\" set rs = Conn.Execute (sql) %> <div align=\"left\"> <table border=\"0\" width=250 cellspacing=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\"> <% Do while NOT rs.EOF ColNum = 1 Do while ColNum < 3 %> <TD ALIGN=LEFT VALIGN=top><font face=\"Verdana\" size=1><b><%=rs(\"cat\")%> </a></b></font> <% ParentID = rs(\"id\") sqlcount = \"SELECT count(url) FROM link2 where parentid=\'\" & rs(\"id\") & \"\' and show=yes\" Set RScounts = Conn.Execute(sqlcount) rcounts = RScounts(0) Response.Write \"<br>\" subsql = \"SELECT top 3 * FROM subcat where catID=\'\" & ParentID & \"\' order by subcatname\" set rssubcat = conn.Execute(subsql) count = rssubcat.RecordCount count = 1 do while not rssubcat.EOF and count<=3 %><font face=\"Verdana\"> </font> <font face=\"Verdana\" size=1><a href=\"showlink.asp?CatID=<%=rssubcat(\"subcatID\")%>&parentID=<%=rs(\"id\")%>&parentname=<%=server.urlencode(rs(\"cat\"))%>&Subname=<%=server.urlencode(rssubcat(\"Subcatname\"))%>\"><%=rssubcat(\"subcatname\")%></a><p style=\"margin-top: 0; margin-bottom: 0\"></font> </p> <% rssubcat.movenext loop %><font face=\"Verdana\"> </font> </td> <% if NOT rs.EOF then rs.MoveNext end if ColNum = ColNum + 1 if NOT rs.EOF then %> </tr> <% end if ColNum = ColNum + 1 Loop %> </TR> <% if NOT rs.EOF then rs.MoveNext end if Loop %> </TABLE> </div> <% rs.close Conn.Close set Conn = nothing %> <CENTER> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </CENTER> <center> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </center> hvad har jeg lavet forkert ???
Annonceindlæg fra Infor
05. januar 2002 - 21:26
#1
kun halvdelen af hvad? af tabellerne? af teksten eller hvad? forklar lidt nærmere
05. januar 2002 - 21:28
#2
alså når jeg køre scriptet får jeg kun havdelen af det databasen indeholder trukket ud :-/
05. januar 2002 - 21:30
#3
så vidt jeg kan se skriver den kun 3 poster ud.
05. januar 2002 - 21:30
#4
<% Response.Cookies(\"tgDate\") = now()%> <body topmargin=\"0\" leftmargin=\"0\"> <center> <% Conn_String = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"link.mdb\") Set Conn=Server.CreateObject(\"ADODB.Connection\") Conn.Open Conn_String sql = \"select * from cat order by cat\" set rs = Conn.Execute (sql) %> <div align=\"left\"> <table border=\"0\" width=250 cellspacing=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\"> <% While NOT rs.EOF %> <TD ALIGN=LEFT VALIGN=top><font face=\"Verdana\" size=1><b><%=rs(\"cat\")%> </a></b></font> <% ParentID = rs(\"id\") sqlcount = \"SELECT count(url) FROM link2 where parentid=\'\" & rs(\"id\") & \"\' and show=yes\" Set RScounts = Conn.Execute(sqlcount) rcounts = RScounts(0) Response.Write \"<br>\" subsql = \"SELECT top 3 * FROM subcat where catID=\'\" & ParentID & \"\' order by subcatname\" set rssubcat = conn.Execute(subsql) count = rssubcat.RecordCount count = 1 do while not rssubcat.EOF and count<=3 %><font face=\"Verdana\"> </font> <font face=\"Verdana\" size=1><a href=\"showlink.asp?CatID=<%=rssubcat(\"subcatID\")%>&parentID=<%=rs(\"id\")%>&parentname=<%=server.urlencode(rs(\"cat\"))%>&Subname=<%=server.urlencode(rssubcat(\"Subcatname\"))%>\"><%=rssubcat(\"subcatname\")%></a><p style=\"margin-top: 0; margin-bottom: 0\"></font> </p> <% rssubcat.movenext loop %><font face=\"Verdana\"> </font> </td> <% rs.MoveNext Wend ColNum = ColNum + 1 if NOT rs.EOF then %> </tr> <% end if ColNum = ColNum + 1 %> </TR> <% if NOT rs.EOF then rs.MoveNext end if Loop %> </TABLE> </div> <% rs.close Conn.Close set Conn = nothing %> <CENTER> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </CENTER> <center> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </center>
05. januar 2002 - 21:31
#5
er det ved alle 3 sql sætninger du kun får halvdelen ud??
05. januar 2002 - 21:33
#6
ikke kun 3, men halvdelen
05. januar 2002 - 21:34
#7
<% Response.Cookies(\"tgDate\") = now()%> <body topmargin=\"0\" leftmargin=\"0\"> <center> <% Conn_String = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"link.mdb\") Set Conn=Server.CreateObject(\"ADODB.Connection\") Conn.Open Conn_String sql = \"select * from cat order by cat\" set rs = Conn.Execute (sql) %> <div align=\"left\"> <table border=\"0\" width=250 cellspacing=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\"> <% While NOT rs.EOF %> <TD ALIGN=LEFT VALIGN=top><font face=\"Verdana\" size=1><b><%=rs(\"cat\")%> </a></b></font> <% ParentID = rs(\"id\") sqlcount = \"SELECT count(url) FROM link2 where parentid=\'\" & rs(\"id\") & \"\' and show=yes\" Set RScounts = Conn.Execute(sqlcount) rcounts = RScounts(0) Response.Write \"<br>\" subsql = \"SELECT top 3 * FROM subcat where catID=\'\" & ParentID & \"\' order by subcatname\" set rssubcat = conn.Execute(subsql) count = rssubcat.RecordCount count = 1 while not rssubcat.EOF %><font face=\"Verdana\"> </font> <font face=\"Verdana\" size=1><a href=\"showlink.asp?CatID=<%=rssubcat(\"subcatID\")%>&parentID=<%=rs(\"id\")%>&parentname=<%=server.urlencode(rs(\"cat\"))%>&Subname=<%=server.urlencode(rssubcat(\"Subcatname\"))%>\"><%=rssubcat(\"subcatname\")%></a><p style=\"margin-top: 0; margin-bottom: 0\"></font> </p> <font face=\"Verdana\"> </font> </td> </tr> </TR> <% rs.MoveNext rssubcat.MoveNext Wend Wend %> </TABLE> </div> <% rs.close Conn.Close set Conn = nothing %> <CENTER> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </CENTER> <center> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </center>
05. januar 2002 - 21:35
#8
medions -->> får denne fejl nu Microsoft VBScript compilation (0x800A040E) \'loop\' without \'do\' serveroutput/index.asp, line 60 Loop
05. januar 2002 - 21:37
#9
med den anden kode du kom med får jeg samme resultat som den jeg selv kom med, dvs får kun halvdelen skrevet ud...
05. januar 2002 - 21:39
#10
så prøv lige denne: <% Response.Cookies(\"tgDate\") = now()%> <body topmargin=\"0\" leftmargin=\"0\"> <center> <% Conn_String = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"link.mdb\") Set Conn=Server.CreateObject(\"ADODB.Connection\") Conn.Open Conn_String sql = \"select * from cat order by cat\" set rs = Conn.Execute (sql) %> <div align=\"left\"> <table border=\"0\" width=250 cellspacing=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\"> <% While NOT rs.EOF %> <tr> <TD ALIGN=LEFT VALIGN=top><font face=\"Verdana\" size=1><b><%=rs(\"cat\")%> </a></b></font> <% ParentID = rs(\"id\") sqlcount = \"SELECT count(url) FROM link2 where parentid=\'\" & rs(\"id\") & \"\' and show=yes\" Set RScounts = Conn.Execute(sqlcount) rcounts = RScounts(0) Response.Write \"<br>\" subsql = \"SELECT top 3 * FROM subcat where catID=\'\" & ParentID & \"\' order by subcatname\" set rssubcat = conn.Execute(subsql) count = rssubcat.RecordCount count = 1 %><font face=\"Verdana\"> </font> <font face=\"Verdana\" size=1><a href=\"showlink.asp?CatID=<%=rssubcat(\"subcatID\")%>&parentID=<%=rs(\"id\")%>&parentname=<%=server.urlencode(rs(\"cat\"))%>&Subname=<%=server.urlencode(rssubcat(\"Subcatname\"))%>\"><%=rssubcat(\"subcatname\")%></a><p style=\"margin-top: 0; margin-bottom: 0\"></font> </p> <font face=\"Verdana\"> </font> </td> </tr> <% rs.MoveNext Wend %> </TABLE> </div> <% rs.close Conn.Close set Conn = nothing %> <CENTER> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </CENTER> <center> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </center>
05. januar 2002 - 21:40
#11
jeg er stadig ikke helt med - har du et sted man kan se eksempelt?
05. januar 2002 - 21:44
#12
keysersoze -->> 2 sek
05. januar 2002 - 21:44
#13
hmm.. så prøv med dette: <% Response.Cookies(\"tgDate\") = now()%> <% Response.Buffer = True %> <body topmargin=\"0\" leftmargin=\"0\"> <center> <% Conn_String = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"link.mdb\") Set Conn=Server.CreateObject(\"ADODB.Connection\") Conn.Open Conn_String sql = \"select * from cat order by cat\" set rs = Conn.Execute (sql) %> <div align=\"left\"> <table border=\"0\" width=250 cellspacing=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\"> <% While NOT rs.EOF %> <tr> <TD ALIGN=LEFT VALIGN=top><font face=\"Verdana\" size=1><b><%=rs(\"cat\")%> </a></b></font> <% ParentID = rs(\"id\") sqlcount = \"SELECT count(url) FROM link2 where parentid=\'\" & rs(\"id\") & \"\' and show=yes\" Set RScounts = Conn.Execute(sqlcount) rcounts = RScounts(0) Response.Write \"<br>\" subsql = \"SELECT top 3 * FROM subcat where catID=\'\" & ParentID & \"\' order by subcatname\" set rssubcat = conn.Execute(subsql) count = rssubcat.RecordCount count = 1 %><font face=\"Verdana\"> </font> <font face=\"Verdana\" size=1><a href=\"showlink.asp?CatID=<%=rssubcat(\"subcatID\")%>&parentID=<%=rs(\"id\")%>&parentname=<%=server.urlencode(rs(\"cat\"))%>&Subname=<%=server.urlencode(rssubcat(\"Subcatname\"))%>\"><%=rssubcat(\"subcatname\")%></a><p style=\"margin-top: 0; margin-bottom: 0\"></font> </p> <font face=\"Verdana\"> </font> </td> </tr> <% rs.MoveNext Wend %> </TABLE> </div> <% rs.close Conn.Close set Conn = nothing %> <CENTER> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </CENTER> <center> <p style=\"margin-top: 0; margin-bottom: 0\"> </p> </center>
05. januar 2002 - 21:46
#14
05. januar 2002 - 21:48
#15
den sidste findes ikke...
05. januar 2002 - 22:05
#16
jo den sidste finden, den virker bare ikke
05. januar 2002 - 22:08
#17
nu kan jeg slet ikke se nogle af dem
05. januar 2002 - 22:26
#18
det burde du kunne
Kurser inden for grundlæggende programmering