473,396 Members | 2,030 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,396 software developers and data experts.

Microsoft VBScript runtime (0x800A000D)

2
Hello:

I have Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "d-03-07, 0"]'
/OnlineLIB/BNosearch1.asp, line 32

The error happened at this line:bookno = chr(bookno)

The code like this:

Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  2. <!--#include file="Connections/Dcon.asp" -->
  3. <%
  4. Dim empno, dept, bookno, bookname, issuedate, returndate
  5.  
  6. Dim Recordset1, Recordset2
  7. Dim Recordset1_numRows
  8. Set Conn = Server.CreateObject("ADODB.Connection")
  9. 'Conn.open "DSN=MQIS"
  10. Conn.open "Driver={SQL Server};Server=KBLPC027;Database=libraryinfo;Trusted_Connection=Yes;"
  11. 'Conn.open "Initial Catalog=lib;Data Source=KBLPC107;Integrated Security=SSPI"
  12. 'Conn.open "Driver={SQL Server};Server=KBLPC107;Database=lib;Uid=sa;Pwd=;"
  13. %> 
  14. <%
  15. Set Recordset1 = Server.CreateObject("ADODB.Recordset")
  16. Recordset1.ActiveConnection = MM_Dcon_STRING
  17. Recordset1.Source = "SELECT *  FROM dbo.transact"
  18. Recordset1.CursorType = 0
  19. Recordset1.CursorLocation = 2
  20. Recordset1.LockType = 1
  21. Recordset1.Open()
  22.  
  23. Recordset1_numRows = 0
  24.  
  25. '----- Populate If Posted any Data
  26. bookno = Request.Form("book_no")
  27. 'search = Request.Form("search")
  28.  
  29. If bookno = "" Then
  30.     bookno = 0
  31. Else
  32.     bookno = chr(bookno)
  33. End If
  34.  
  35. If bookno = 0 Then
  36.     empno = ""
  37.     dept = ""
  38.     bookname = ""
  39.     issuedate = ""
  40.     returndate = ""
  41. Else
  42.     Set Recordset2 = Server.CreateObject("ADODB.Recordset")
  43.     Set Recordset2 = conn.Execute("SELECT * FROM transact WHERE book_no = " & bookno)
  44.     If Recordset2.BOF = True Then
  45.         empno = ""
  46.         dept = ""
  47.         bookname = ""
  48.         issuedate = ""
  49.         returndate = ""
  50.     Else
  51.         empno = Recordset2("emp_no")
  52.         dept = Recordset2("dept")
  53.         bookname = Recordset2("book_name")
  54.         issuedate = Recordset2("issue_date")
  55.         returndate = Recordset2("return_date")
  56.     End If
  57. End If
  58. %>
  59. <html>
  60. <head>
  61. <title>Untitled Document</title>
  62. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  63. </head>
  64.  
  65. <body bgcolor="#FFBFE1">
  66. <form name="form1" method="post" action="">
  67.   <p align="center">&nbsp;</p>
  68.   <div align="center">
  69.     <table width="590" border="1">
  70.       <tr> 
  71.         <td width="580"><div align="left"><font size="+1"><strong>Search by:</strong> 
  72.             </font><strong><a href="seaching.asp"><font color="#000000">Employee 
  73.             Number</font></a> <font color="#000000"><a href="Book No.asp">Book 
  74.             Number</a> <a href="bookname.asp">Book Name</a> </font></strong></div></td>
  75.       </tr>
  76.     </table>
  77.   </div>
  78.   <div align="center">
  79.     <table width="85%" border="1">
  80.       <tr bgcolor="#CC9966"> 
  81.         <td width="46%" bgcolor="#FF99CC"><strong>S e a r c h B y</strong></td>
  82.         <td width="54%" bgcolor="#FF99CC"> <select name="search">
  83.             <option value="empno">Employee Number</option>
  84.             <option value="dept">Department</option>
  85.             <option value="bookno">Book Number</option>
  86.             <option value="bookname">Book Name</option>
  87.             <option value="issuedate">Issue Date</option>
  88.             <option value="returndate">Return Date</option>
  89.             <option value="available">Availability</option>
  90.           </select>
  91.           <b> 
  92.           <input type="submit" name="Submit" value="  Submit  " style="font-size: 1em; color: #FFFF00; text-decoration: blink; font-family: Arial Narrow; font-weight: bold; background-color: #CA0000; background-image: url('Sandeep_pic/50.gif'); " tabindex="3">
  93.           </b> </td>
  94.       </tr>
  95.     </table>
  96.   </div>
  97.   <p align="center">&nbsp;</p>
  98.   <div align="center"> 
  99.     <table width="85%" border="1">
  100.       <tr> 
  101.         <td width="46%" height="13"><div align="left"><font color="#003300"><strong>Book 
  102.             Number </strong></font></div></td>
  103.         <td width="54%"><div align="left"><font color="#003300"> 
  104.             <select name="book_no" onChange="this.form.submit();">
  105.               <option value="0"></option>
  106.               <%If Recordset1.EOF = False Then 
  107.       Recordset1.MoveFirst
  108.       Do While Recordset1.EOF =False
  109.       %>
  110.               <option value="<%=(Recordset1.Fields.Item("book_no").Value)%>" <%If Recordset1("book_no") = bookno Then %> Selected <%End if%>  ><%=(Recordset1.Fields.Item("book_no").Value)%></option>
  111.               <%Recordset1.MoveNext
  112.       Loop
  113.       End If%>
  114.             </select>
  115.             </font></div></td>
  116.       </tr>
  117.     </table>
  118.   </div>
  119.   <p>&nbsp;</p>
  120.   <div align="center"> 
  121.     <table width="86%" border="1">
  122.       <tr> 
  123.         <td><strong><font color="#660033">E m p l o y e e N u m b e r</font></strong></td>
  124.         <td> <input name="emp_no" type="text" id="emp_no" value="<%= empno %>"> 
  125.         </td>
  126.       </tr>
  127.       <tr> 
  128.         <td><strong><font color="#660033">D e p a r t m e n t</font></strong></td>
  129.         <td><input name="dept" type="text" id="dept" value="<%= dept %>"></td>
  130.       </tr>
  131.       <tr> 
  132.         <td width="46%"><strong><font color="#660033">B o o k N u m b e r </font></strong></td>
  133.         <td width="54%"><input name="book_no" type="text" id="book_no" value="<%= bookno %>"></td>
  134.       </tr>
  135.       <tr> 
  136.         <td><strong><font color="#660033">B o o k N a m e</font></strong> </td>
  137.         <td><input name="book_name" type="text" id="book_name" value="<%= bookname %>"></td>
  138.       </tr>
  139.       <tr> 
  140.         <td><strong><font color="#660033">I s s u e D a t e</font></strong></td>
  141.         <td><input name="issue_date" type="text" id="issue_date" value="<%= issuedate %>"></td>
  142.       </tr>
  143.       <tr> 
  144.         <td><strong><font color="#660033">R e t u r n D a t e</font></strong></td>
  145.         <td><input name="return_date" type="text" id="return_date" value="<%= returndate %>"></td>
  146.       </tr>
  147.     </table>
  148.   </div>
  149.   <p>&nbsp;</p>
  150.   <div align="center"> 
  151.     <table width="86%" border="1">
  152.       <tr> 
  153.         <td height="23" bgcolor="#FF99CC"><div align="center"> </div></td>
  154.       </tr>
  155.     </table>
  156.   </div>
  157.   <p>&nbsp;</p>
  158.   <p>&nbsp;</p>
  159.   <p>&nbsp;</p>
  160. </form>
  161. </body>
  162. </html>
  163. <%
  164. Recordset1.Close()
  165. Set Recordset1 = Nothing
  166. %>
  167. .....
  168.  
I got mismatch "'[string: "d-03-07, 0"]'
" error.

What am I missing here?

Your help is highly appreciated.
Apr 26 '07 #1
1 4054
jhardman
3,406 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. '----- Populate If Posted any Data
  2. 'bookno = Request.Form("book_no")
  3. 'search = Request.Form("search")
  4.  
  5. If request.form("book_no") = "" Then
  6.     bookno = chr(0)
  7. Else
  8.     bookno = chr(request.form("book_no"))
  9. End If
  10.  
The problem was coming up because you tried to change the variable type. Even though you don't choose a variable type when you declare a variable, you can't change the type of variable after it is assigned a value.

Let me know if this helps.

Jared
Apr 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Matt | last post by:
<% hour = Request("controlname") %> will yield the following error: Microsoft VBScript runtime (0x800A01F5) Illegal assignment: 'hour' However, if I declare hour, then it is fine. <% Dim...
1
by: PaulieS | last post by:
Hi all. Am migrating a customer from IIS5 on W2K server to IIS6 on W2K3. Zipped all the websites and unzipped them to the identical locations on new server. Used IISMT to migrate metabase. ...
3
by: Snow | last post by:
Hello: I have Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: '' The error happened at this line: if session("systemIdCount" & arrSystems(iLoop)) 0 The code like this:
2
by: anidmarty | last post by:
Hey I'm a Sysadmin and my users are getting this error on my production box. It works fine on the dev box. There is a script that is run that generates this error. Production is clustered...
0
by: =?Utf-8?B?TWF0dCBDYWxob29u?= | last post by:
HI there, I am getting an error on my page which calls up a web service. Microsoft VBScript runtime error '800a13ba' Unknown runtime error: 'SearchQueryXML' /SearchResults.asp, line 142
0
by: monika | last post by:
Hello: I have Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: '' The error happened at this line:bookno = chr(bookno) The code like this: bookno =...
4
by: Genken | last post by:
Hi can anybody help me i get this error when running this code. Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '' And then a line number indicating where the error is, i...
1
by: FOREST GOLDEN | last post by:
i'M want to select multiple choice by using checkbox, but it come out the above mistake, plz help me solve it, thankx....... my ItemCode is using text eg:cg001 <%@ Language=VBScript %> <HTML>...
10
by: jasone | last post by:
hi everyone! any advice given will be MUCH appreciated, i have spent about 10 hours on this bit of script... a rating system. I am having realt trouble overcoming this problem at runtime ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.