•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 373,099 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,831 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 369 | Replies: 1
![]() |
•
•
Join Date: Dec 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Using VB ASP Access.
Here's the error I'm getting:
Here's the code:
Here's the error I'm getting:
•
•
•
•
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/RP_Ref_Guide/RP_search_results.asp, line 23
Browser Type:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
Page:
POST 109 bytes to /RP_Ref_Guide/RP_search_results.asp
POST Data:
Partner_Name=Agilsys+Hospitality+Systems&Relationship=&Industry=&Partner_Manager=&Territory=&RP_Search=Search
Here's the code:
VBSCRIPT Syntax (Toggle Plain Text)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!--#include file="Connections/RP_DB.asp" --> <% rp_name = Request.Form("Partner_Name") rp_rel = Request.Form("Relationship") rp_ind = Request.Form("Industry") rp_mgr = Request.Form("Partner_Manager") rp_ter = Request.Form("Territory") Dim results1 Dim results1_cmd Dim results1_numRows Set results1_cmd = Server.CreateObject ("ADODB.Command") results1_cmd.ActiveConnection = MM_RP_DB_STRING results1_cmd.CommandText = "SELECT Partner_company, Terr_Name, partnerManager_name, relationship_name, industry_name FROM RP_Search_results" results1_cmd.Prepared = true Set results1 = results1_cmd.Execute results1_numRows = 0 %> <% ======> IF rp_name <> "" THEN results1 = results1 &_ <===== " WHERE Partner_company = '" & rp_name & "'" IF rp_mgr <> "" AND rp_name = "" THEN results1 = results1 &_ " WHERE partnerManager_name = '" & rp_mgr & "'" IF rp_mgr <> "" AND rp_name <> "" THEN results1 = results1 &_ " AND partnerManager_name = '" & rp_mgr & "'" IF rp_ter <> "" AND (rp_mgr = "" AND rp_name = "") THEN results1 = results1 &_ " WHERE Terr_Name = '" & rp_ter & "'" IF rp_ter <> "" AND (rp_mgr <> "" OR rp_name <> "") THEN results1 = results1 &_ " AND Terr_Name = '" & rp_ter & "'" IF rp_rel <> "" AND (rp_mgr = "" AND rp_name = "" AND rp_ter = "" ) THEN results1 = results1 &_ " WHERE relationship_name = '" & rp_rel & "'" IF rp_rel <> "" AND (rp_mgr <> "" OR rp_name <> "" OR rp_ter <> "") THEN results1 = results1 &_ " AND relationship_name = '" & rp_rel & "'" IF rp_ind <> "" AND (rp_mgr = "" AND rp_name = "" AND rp_ter = "" AND rp_rel = "" ) THEN results1 = results1 &_ " WHERE industry_name = '" & rp_ind & "'" IF rp_ind <> "" AND (rp_mgr <> "" OR rp_name <> "" OR rp_ter <> "" OR rp_rel <> "") THEN results1 = results1 &_ " AND industry_name = '" & rp_ind & "'" response.Write(results1) response.End(results1) %>
•
•
Join Date: Apr 2008
Posts: 20
Reputation:
Rep Power: 1
Solved Threads: 3
Look at line 19 in your code.
You have initialized results1 as an ADODB.Recordset object.
You problem lies in that you are trying to append a string to the recordset object.
Instead, you need to be appending to results1_cmd.CommandText. Better yet, define a variable to hold the string, append to it and then set the results1_cmd.CommandText = variable.
Set results1 = results1_cmd.ExecuteYou have initialized results1 as an ADODB.Recordset object.
You problem lies in that you are trying to append a string to the recordset object.
IF rp_mgr <> "" AND rp_name = "" THEN results1 = results1 &_ ...Instead, you need to be appending to results1_cmd.CommandText. Better yet, define a variable to hold the string, append to it and then set the results1_cmd.CommandText = variable.
Last edited by techtix : Apr 3rd, 2008 at 8:53 pm.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
Similar Threads
- Type Mismatch error with Time formatting - Using Visual Basic for Excel Macro (Visual Basic 4 / 5 / 6)
- Type Mismatch Error (MS SQL)
- Help with asp error (ASP)
- how to sort out type mismatch error while retreiving attribute from LDAP (Visual Basic 4 / 5 / 6)
- Info in Database converted to Chart (Visual Basic 4 / 5 / 6)
- error with win2k, memory could not be "read" (Windows NT / 2000 / XP / 2003)
- internet explorer script error (Windows 9x / Me)
Other Threads in the ASP Forum
- Previous Thread: *New to ASP* - Trying to export Access table to excel
- Next Thread: ASP Newbee


Linear Mode