error while trying to create a random text display
-
somehow.... I receive an error saying that Type mismatch test1.asp, line 11 why is that so???? I had set the Path correct..... table is correct and rs.fields are correct also <% Set conn = Server.CreateObject("ADODB.Connection") DBPath = "Provider=SQLOLEDB;Data Source=SITDB580;....;" conn.Open DBPath Set rsDaten=Server.CreateObject("ADODB.Recordset") strSQL="SELECT * FROM testimonials" rsDaten.Open strSQL,conn,0,3 nTotalRecs = rsDaten(0) if nTotalRecs <> 0 then <======line 11 rsDaten.MoveNext nTotalMax = rsDaten(0) rsDaten.MoveNext nTotalMin = rsDaten(0) end if rsDaten.Close Randomize intChoice = Int((nTotalMax - nTotalMin + 1) * Rnd + nTotalMin) Set rs=Server.CreateObject("ADODB.Recordset") strSQL="SELECT * from testimonials where ID="&intChoice &"" rs.Open strSQL,conn strText=rs.Fields("Text") strAuthor=rs.Fields("Author") if not rs.EOF then %> <%if strAuthor<>"" then %> <%end if %>
<%=strText %>
- <%=strAuthor%> -
<% end if rs.close conn.close %>
-
somehow.... I receive an error saying that Type mismatch test1.asp, line 11 why is that so???? I had set the Path correct..... table is correct and rs.fields are correct also <% Set conn = Server.CreateObject("ADODB.Connection") DBPath = "Provider=SQLOLEDB;Data Source=SITDB580;....;" conn.Open DBPath Set rsDaten=Server.CreateObject("ADODB.Recordset") strSQL="SELECT * FROM testimonials" rsDaten.Open strSQL,conn,0,3 nTotalRecs = rsDaten(0) if nTotalRecs <> 0 then <======line 11 rsDaten.MoveNext nTotalMax = rsDaten(0) rsDaten.MoveNext nTotalMin = rsDaten(0) end if rsDaten.Close Randomize intChoice = Int((nTotalMax - nTotalMin + 1) * Rnd + nTotalMin) Set rs=Server.CreateObject("ADODB.Recordset") strSQL="SELECT * from testimonials where ID="&intChoice &"" rs.Open strSQL,conn strText=rs.Fields("Text") strAuthor=rs.Fields("Author") if not rs.EOF then %> <%if strAuthor<>"" then %> <%end if %>
<%=strText %>
- <%=strAuthor%> -
<% end if rs.close conn.close %>