|
-
Jan 17th, 2003, 09:56 AM
#1
Thread Starter
Lively Member
Matching Values from Recordset
Ok I have a little (big) problem...I have 2 recordsets...1 of them only returns 1 value...the other recordset gives me more values...I loop through the recordset...And try to check if both values are the same...If they are the same I write BLA to the screen...
VB Code:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/conn.asp" -->
<%
set rsCall = Server.CreateObject("ADODB.Recordset")
rsCall.ActiveConnection = MM_connMSIS_STRING
rsCall.Source = "SELECT ContactID FROM dbo.Calls WHERE CallID = 38"
rsCall.CursorType = 0
rsCall.CursorLocation = 2
rsCall.LockType = 3
rsCall.Open()
rsCall_numRows = 0
%>
<%
set rsContactje = Server.CreateObject("ADODB.Recordset")
rsContactje.ActiveConnection = MM_connMSIS_STRING
rsContactje.Source = "SELECT ContactID, Achternaam FROM Contactpersonen WHERE FirmaID = 3503167"
rsContactje.CursorType = 0
rsContactje.CursorLocation = 2
rsContactje.LockType = 3
rsContactje.Open()
rsContactje_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsContactje_numRows = rsContactje_numRows + Repeat1__numRows
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="75%" border="1">
<%
While ((Repeat1__numRows <> 0) AND (NOT rsContactje.EOF))
%>
<tr>
<td><%=(rsCall.Fields.Item("ContactID").Value)%></td>
<td>
<% If (rsCall.Fields.Item("ContactID").Value = rsContactje.Fields.Item("ContactID").Value) Then %>
BLA
<% End If %> #####LINE 45#####
</td>
<td><%=(rsContactje.Fields.Item("ContactID").Value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsContactje.MoveNext()
Wend
%>
</table>
</body>
</html>
<%
rsCall.Close()
%>
<%
rsContactje.Close()
%>
When I run the code...I get the following error...
Microsoft VBScript runtime error '800a000d'
Type mismatch
/develop/TestsChris/TMPgd0um8v5f3.asp, line 45
Does anyone have a clue on what goes wrong?
-
Jan 17th, 2003, 10:58 AM
#2
Frenzied Member
Are these two tables, that you are comparing, in the same database?
-
Jan 17th, 2003, 01:56 PM
#3
Check to see if the ContactID field of both tables are of the same datatype.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|