Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 13th, 2003, 08:42 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Type mismatch

It's me again. I've got the SQL server working now, thanks to Chris. Now it gives me this error:

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch

This is the only error I've gotten since the switch from access to sql. The code for the error line is as follows:

  If Not (StrComp(objRS("password"), strpass, _
        vbBinaryCompare) = 0) Then
    objRS.Close
    Set objRS = Nothing
    objConn.Close
    Set objConn = Nothing
    Response.Write "<A HREF='index.html'> User name did not match up to password. </A> <P>"
    Response.End
  End If

The error strikes on that first line. Any help would be great thanks.

  #2 (permalink)  
Old August 13th, 2003, 09:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have never used the StrComp function, but the error simply means that one of the values you are passing in is not the same type as the value the function should receive. I have run into this a few times when passing in an int into a double or something like that. Maybe explicitly cast them before they hit the function:

Code:
If Not (StrComp(Cstr(objRS("password")), cstr(strpass), _
        vbBinaryCompare) = 0) Then


These are my thoughts. Maybe they are not even hitting close. Beyond this, I am not sure as of yet. Try that and see. Maybe recheck the parameter datatypes again.

Chris
  #3 (permalink)  
Old August 13th, 2003, 12:57 PM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No dice with Chris's advice. Rhyme scheme is working apparently. Any other ideas? Perhaps there is a similar function I could use?

  #4 (permalink)  
Old August 13th, 2003, 02:32 PM
Authorized User
 
Join Date: Jun 2003
Location: , Quebec, Canada.
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you check the value of vbBinaryCompare? It should be equal to 0. With what Chris have suggest, can't find anything wrong whit the code.

St├ęphane Lajoie
  #5 (permalink)  
Old August 14th, 2003, 03:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by sporkman43
 No dice with Chris's advice. Rhyme scheme is working apparently. Any other ideas? Perhaps there is a similar function I could use?
Umm, how about just using = (or <> in your case).
If objRS("password") <> strpass Then ...


Similar Threads
Thread Thread Starter Forum Replies Last Post
type mismatch frresh Pro Visual Basic 2005 1 April 11th, 2006 08:35 AM
Type Mismatch Anup Gavate VB How-To 4 March 28th, 2005 01:48 PM
Type mismatch NoBullMan Classic ASP Basics 2 November 16th, 2004 03:16 AM
Type mismatch per.holleufer Classic ASP Basics 5 July 31st, 2004 07:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.