User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Dec 2007
Posts: 6
Reputation: vicshoup is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vicshoup vicshoup is offline Offline
Newbie Poster

Mismatch Error

  #1  
Apr 1st, 2008
Using VB ASP Access.

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:

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <!--#include file="Connections/RP_DB.asp" -->
  3. <%
  4. rp_name = Request.Form("Partner_Name")
  5. rp_rel = Request.Form("Relationship")
  6. rp_ind = Request.Form("Industry")
  7. rp_mgr = Request.Form("Partner_Manager")
  8. rp_ter = Request.Form("Territory")
  9.  
  10. Dim results1
  11. Dim results1_cmd
  12. Dim results1_numRows
  13.  
  14. Set results1_cmd = Server.CreateObject ("ADODB.Command")
  15. results1_cmd.ActiveConnection = MM_RP_DB_STRING
  16. results1_cmd.CommandText = "SELECT Partner_company, Terr_Name, partnerManager_name, relationship_name, industry_name FROM RP_Search_results"
  17. results1_cmd.Prepared = true
  18.  
  19. Set results1 = results1_cmd.Execute
  20. results1_numRows = 0
  21. %>
  22. <%
  23. ======> IF rp_name <> "" THEN results1 = results1 &_ <=====
  24. " WHERE Partner_company = '" & rp_name & "'"
  25. IF rp_mgr <> "" AND rp_name = "" THEN results1 = results1 &_
  26. " WHERE partnerManager_name = '" & rp_mgr & "'"
  27. IF rp_mgr <> "" AND rp_name <> "" THEN results1 = results1 &_
  28. " AND partnerManager_name = '" & rp_mgr & "'"
  29. IF rp_ter <> "" AND (rp_mgr = "" AND rp_name = "") THEN results1 = results1 &_
  30. " WHERE Terr_Name = '" & rp_ter & "'"
  31. IF rp_ter <> "" AND (rp_mgr <> "" OR rp_name <> "") THEN results1 = results1 &_
  32. " AND Terr_Name = '" & rp_ter & "'"
  33. IF rp_rel <> "" AND (rp_mgr = "" AND rp_name = "" AND rp_ter = "" ) THEN results1 = results1 &_
  34. " WHERE relationship_name = '" & rp_rel & "'"
  35. IF rp_rel <> "" AND (rp_mgr <> "" OR rp_name <> "" OR rp_ter <> "") THEN results1 = results1 &_
  36. " AND relationship_name = '" & rp_rel & "'"
  37. IF rp_ind <> "" AND (rp_mgr = "" AND rp_name = "" AND rp_ter = "" AND rp_rel = "" ) THEN results1 = results1 &_
  38. " WHERE industry_name = '" & rp_ind & "'"
  39. IF rp_ind <> "" AND (rp_mgr <> "" OR rp_name <> "" OR rp_ter <> "" OR rp_rel <> "") THEN results1 = results1 &_
  40. " AND industry_name = '" & rp_ind & "'"
  41. response.Write(results1)
  42. response.End(results1)
  43. %>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2008
Posts: 20
Reputation: techtix is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 3
techtix techtix is offline Offline
Newbie Poster

Re: Mismatch Error

  #2  
Apr 3rd, 2008
Look at line 19 in your code.
Set results1 = results1_cmd.Execute

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.
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 5:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC