473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

help type mismatch

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

Feb 17 '06 #1
6 2351
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!

"isaac2004" <is********@yahoo.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
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

Feb 17 '06 #2
<snipped>
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

Feb 17 '06 #3
"Lee Carnell" <leexcarnell@gmailxcom> wrote in message
news:43**********************@news.aaisp.net.uk...
</snip>

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!
Feb 17 '06 #4
>> 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>)

--


I was surprised that you missed it :)
Feb 17 '06 #5
"Lee Carnell" <leexcarnell@gmailxcom> wrote in message
news:43**********************@news.aaisp.net.uk...
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>)

--


I was surprised that you missed it :)


I was more disgusted than surprised ... lol

--
Regards

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

Keeping it FREE!
Feb 17 '06 #6
>I was more disgusted than surprised ... lol
wow i feel dumb thanks for the help

Feb 17 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: LJgrnl | last post by:
I've got a type mismatch error that's driving me nutty. Variable blnNoData has the initial value False. If a recordset comes back empty (both .EOF and ..BOF are true) then blnNoData is set to...
1
by: Brett | last post by:
I have a form that calls a method within a DLL. By clicking a button on the form, the DLL is instantiated and the SaveOutlookMessage() method invoked. The DLL code copies messages from Outlook to...
6
by: Howard Kaikow | last post by:
I'm doing a VB 6 project in which I am trying to protect against type mismatch errors. Is the process any different in VB .NET? Here's what I'm doing in VB 6. I have an ActiveX DLL. The...
9
by: isaac2004 | last post by:
hi i have a page that inclued a SQL statement that takes a user input from a form and displays the request from the database. every time i try to open the page i get an error message that says Data...
2
by: Rehan | last post by:
Hi there! Please help me out here. I am an inch away from completing my assignment. I am very new to VBA but i have very less time to be efficient at it. I am getting a type mismatch error...
5
by: Davros9 | last post by:
Trying to get Regular Expressions working....... ---------------- Public Function SepString(InField As String) As String ''seperates on space and comma Dim RE As New RegExp Dim Matches As...
47
by: Jo | last post by:
Hi there, I'm Jo and it's the first time I've posted here. I'm in process of creating a database at work and have come a little unstuck.....I'm a bit of a novice and wondered if anyone could...
9
by: sara | last post by:
Hi - I have code (below) that ran as recently as Monday. We decided to change the location for the output reports, and now the code errors (13 Type Mismatch) on the query. The query runs fine...
2
by: embz | last post by:
this post concerns three pages. 1. this page: http://www.katherine-designs.com/sendemail.php i get the following errors: a lot of it seems to deal with the PHP code i inserted to the page....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.