help type mismatch

I

isaac2004

hello i am getting a type mismatch for a page i am trying to write. any
help would be great

source code

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="DatabaseConnect.asp"-->
<!--#include virtual="06winter/levini/database/adovbs.inc"-->
<html>
<head><title>Geekbooks.com</title></head>
<table

<!-- Header SSI starts here-->
<!--#include file="header.html"-->
<!-- Header SSI ends here-->
<!-- Menu SSI starts here-->
<!--#include file="menu.asp"-->
<!-- Menu SSI ends here-->

<% Dim strSQL, objRS, intBookID, strItemType

randomize
intBookID = int(11 * rnd(1)) +1

strSQL = "SELECT tblBookDescription.ISBN, tblBookDescription.BookID,
tblBookDescription.strTitle, tblBookDescription.strDescription " & _
"FROM tblBookDescription " & _
"WHERE (((tblBookDescription.BookID)=6)) OR
(((tblBookDescription.BookID)=7)) OR (((tblBookDescription.BookID)=8));
"


response.write("strSQL = " & strSQL)

---------------------------------------------error type mismatch
strISBN = objRS("ISBN")
--------------------------------------------------------------------
strTitle = objRS("strTitle")
strDescription = objRS("strDescription")

Set objRS = Server.CreateObject("ADODB.Recordset")

objRS.open strSQL, objConn



objRS.close
Set objRS = nothing
objConn.close
Set objRS = nothing

%>




</td>
<td valign="top"><font face="Comic Sans MS"
color="#CC0000">Today's Featured Books</font>
<table border="0">
<tr>
<td>
<p><font face="Comic Sans MS" color="#006699"> <%
=strTitle%> </font><br>

<a href="ProductPage.asp?isbn=<% =strISBN%>">
<img height="97" width="69" hspace="7"
vspace="3" src="/sandvig/bookstore/images/<%
=strISBN%>.01.20TLZZZZ.gif" align="left" border="0">
</a>

<% =strDescription %>
<a href="ProductPage.asp?isbn=<% =strISBN%>">
more...</a>
</td>
</tr>
<tr>
<td>
<p><font face="Comic Sans MS" color="#006699"> <%
=strTitle%> </font><br>

<a href="ProductPage.asp?isbn=<% =strISBN%>">
<img height="97" width="69" hspace="7"
vspace="3" src="/sandvig/bookstore/images/<%
=strISBN%>.01.20TLZZZZ.gif" align="left" border="0">
</a>

<% =strDescription %>
<a href="ProductPage.asp?isbn=<% =strISBN%>">
more...</a>
</td>
</tr>
<tr>
<td>
<p><font face="Comic Sans MS" color="#006699"> <%
=strTitle%> </font><br>

<a href="ProductPage.asp?isbn=<% =strISBN%>">
<img height="97" width="69" hspace="7"
vspace="3" src="/sandvig/bookstore/images/<%
=strISBN%>.01.20TLZZZZ.gif" align="left" border="0">
</a>

<% =strDescription %>
<a href="ProductPage.asp?isbn=<% =strISBN%>">
more...</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<br><br>
</td>
</tr>
</table>
</center>
</div>

<!--#include file="footer.html"-->
<!--Menu SSI ends here-->


</body></html>


is this error from trying to put a record set into a string. help me
please thank you
 
S

Steven Burn

Have you tried........

Response.Write "<b>DEBUG: </b> " & objRS("ISBN")

Will allow you to see whatever is in the field .....?

Or even;

Response.Write "<b>DEBUG: </b> " & objRS("ISBN").Value

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
L

Lee Carnell

strSQL = "SELECT tblBookDescription.ISBN, tblBookDescription.BookID,
tblBookDescription.strTitle, tblBookDescription.strDescription " & _
"FROM tblBookDescription " & _
"WHERE (((tblBookDescription.BookID)=6)) OR
(((tblBookDescription.BookID)=7)) OR (((tblBookDescription.BookID)=8));
"


response.write("strSQL = " & strSQL)

---------------------------------------------error type mismatch
strISBN = objRS("ISBN")
--------------------------------------------------------------------
strTitle = objRS("strTitle")
strDescription = objRS("strDescription")

Set objRS = Server.CreateObject("ADODB.Recordset")

objRS.open strSQL, objConn



objRS.close
Set objRS = nothing
objConn.close
Set objRS = nothing

%>

You're trying to fill the variables before you've opened the recordset - try
this...

[SQL Satement here]

Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.open strSQL, objConn
strISBN = objRS("ISBN")
strTitle = objRS("strTitle")
strDescription = objRS("strDescription")
objRS.close
Set objRS = nothing
objConn.close
Set objRS = nothing


Cheers,

Lee
 
S

Steven Burn

You're trying to fill the variables before you've opened the recordset - try
this...

LMFAO!.... I should've caught that one (serves me right for not sleeping I
suppose <g>)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
L

Lee Carnell

You're trying to fill the variables before you've opened the recordset -
try

LMFAO!.... I should've caught that one (serves me right for not sleeping I
suppose <g>)

--

I was surprised that you missed it :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top