Kazooo Skrevet 20. september 2008 Del Skrevet 20. september 2008 Jeg har et skoleprosjekt hvor jeg skal lage en database om fotballarenaer. Jeg får følgende feilmelding: Microsoft VBScript runtime error '800a000d' på linje 134. Jeg har knota mye, men finner ikke helt ut av det. Noen med råd? Type mismatch: '[string: "Anfield"]' <% option explicit %> <!--#include file="dbconn.asp"--> <% dim stage, SQL, info stage = request.querystring("stage") if stage = "" then stage=1 %> <html> <head> <title>ASP Ugly</title> </head> <body> <% '-------------------------------------------------------------------- if stage = 1 then '------------------------------------------------------------------ %> <br> <p>Please make your choice:</p> <br/> <div id="box2_r"> <form action="stadiums.asp" method="get"> <input type="hidden" name="stage" value="2"> <% '----------- STADIUM -------------- SQL="SELECT StadiumID, StadiumName FROM StadiumTable ORDER BY StadiumName" set info=conn.execute(SQL) response.write " <p>Stadium<br> <select name=""stadiumNum"">"&chr(13) response.write " <option value=""-1"" selected>Any</option>"&chr(13) do until info.eof response.write " <option value=""" & info(0) & """>" & info(1) & "</option>"&chr(13) info.movenext loop response.write " </select></p><br>"&chr(13) '----------- TEAM -------------- SQL="SELECT TeamID, TeamName FROM TeamTable ORDER BY TeamName" set info=conn.execute(SQL) response.write " <p>Team<br> <select name=""teamNum"">"&chr(13) response.write " <option value=""-1"" selected>Any</option>"&chr(13) do until info.eof response.write " <option value=""" & info(0) & """>" & info(1) & "</option>"&chr(13) info.movenext loop response.write " </select></p><br>"&chr(13) '----------- CITY -------------- SQL="SELECT PlaceID, City FROM PlaceTable ORDER BY City" set info=conn.execute(SQL) response.write " <p>City<br> <select name=""cityNum"">"&chr(13) response.write " <option value=""-1"" selected>Any</option>"&chr(13) do until info.eof response.write " <option value=""" & info(0) & """>" & info(1) & "</option>"&chr(13) info.movenext loop response.write " </select></p><br>"&chr(13) '----------- COUNTRY -------------- SQL="SELECT CountryID, Country FROM CountryTable ORDER BY Country " set info=conn.execute(SQL) response.write " <p>Country<br> <select name=""countryNum"">"&chr(13) response.write " <option value=""-1"" selected>Any</option>"&chr(13) do until info.eof response.write " <option value=""" & info(0) & """>" & info(1) & "</option>"&chr(13) info.movenext loop response.write " </select></p><br>"&chr(13) %> <p><input type="submit"></p> </form> </div> <% '------------------------------------------------------------------ elseif stage = 2 then '------------------------------------------------------------------ dim fields fields = Array("Venue Name", "Venue Location", "Contact Number", "Event Email", "Event Style",_ "Event Budget", "Event Capacity") dim stadiumIDs(), stadiums(), f, numStyles SQL = "select count(StadiumID) from StadiumTable" set info = conn.execute(SQL) numStyles = info(0) redim stadiumIDs(numStyles) redim stadiums(numStyles) SQL = "select StadiumID, StadiumName from StadiumTable" set info = conn.execute(SQL) f=0 do while not info.eof stadiumIDs(f) = info(0) stadiums(f) = info(1) info.movenext f = f + 1 loop '--- build the "compulsory" parts of the SQL command ' 0 1 SQL="SELECT StadiumID, StadiumName "&_ " FROM StadiumTable" '--- grab the data from the form dim stadiumNum, teamNum, cityNum, countryNum, stadiumOK, teamOK, cityOK, countryOK stadiumNum = 1*Request.QueryString("stadiumNum") teamNum = 2*Request.QueryString("teamNum") cityNum = 3*Request.QueryString("cityNum") countryNum = 4*Request.QueryString("countryNum") response.write SQL&"<br>"&chr(13)&chr(13) '--- execute the query set info=conn.execute(SQL) if info.eof then response.write " Sorry, no records matching your query"&chr(13) else response.write "stadiumNum="&stadiumNum& "" do while not info.eof response.write info(1)&" : "&chr(13) stadiumOK = true if stadiumNum <> -1 then if (info(1) AND stadiumNum) = stadiumNum then stadiumOK = true else stadiumOK = false response.write "("& info(1)&" AND "&stadiumNum&") = "&(info(1) AND stadiumNum)&" = "&stadiumOK&"<br>" end if end if if stadiumOK then response.write " stadium=OK" if (stadiumOK) then response.write "<a href=""stadiumdetails.asp?id="&info(1)&"></a><br>"&chr(13) end if response.write "<br>"&chr(13) info.movenext loop end if '------------------------------------------------------------------ end if ' stage '------------------------------------------------------------------ response.write " <br clear=""left""><br>"&chr(13) if stage=2 then response.write chr(13) 'response.write " <i>that's all folks!</i><br><br>"&chr(13) end if %> </body> </html> <% conn.close %> Lenke til kommentar
Kazooo Skrevet 20. september 2008 Forfatter Del Skrevet 20. september 2008 ordna sæ Lenke til kommentar
Anbefalte innlegg
Opprett en konto eller logg inn for å kommentere
Du må være et medlem for å kunne skrive en kommentar
Opprett konto
Det er enkelt å melde seg inn for å starte en ny konto!
Start en kontoLogg inn
Har du allerede en konto? Logg inn her.
Logg inn nå