Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript 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 December 6th, 2005, 04:58 AM
Registered User
Join Date: Dec 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Type miss match for Server.CreatObject

I am using a VB 6.0 component in ASP page.I get a "Type miss match" error wherever i used Server.CreateObject method. This method i used for creating a class object of a DLL.
 Here is the code i am using.

Dim objLogin
Set objLogin = Server.CreateObject(Cstr(strComponentName) ".clsLogin")

'Call ValidateUser method of login object.
Set objRSValidLogin = objLogin.ValidateUser(strUserID, strPassword)

strComponentName contains component name.
I am surprised that even if get this error for a page,it does not come if i refresh the page.
Please let me know if you have any ideas on the same.Because i am really not able to find any solution for it.
Thankx in advance!

Reply With Quote
  #2 (permalink)  
Old December 21st, 2005, 02:07 PM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

It seems to me that you would type the variable strComponentName when you are capturing the value, not when you are sending the value. What happens if you remove CStr()?

Reply With Quote
  #3 (permalink)  
Old October 16th, 2006, 04:02 PM
Friend of Wrox
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts

I know this one is very old... but here is the issue:
this line
Set objLogin = Server.CreateObject(Cstr(strComponentName) ".clsLogin")

probably should be:
Set objLogin = Server.CreateObject(Cstr(strComponentName) & ".clsLogin")

Woody Z http://www.learntoprogramnow.com
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
template match doesnt match the required node Tomi XSLT 2 March 12th, 2007 06:24 AM
I do miss grstad Forum and Wrox.com Feedback 0 January 4th, 2007 04:37 PM
Type Miss match error for Server.CreateObject Deepmala Classic ASP Components 0 December 6th, 2005 02:50 AM
Type miss match error Deepmala Classic ASP Databases 0 December 6th, 2005 02:36 AM
what data type in sql server kiwibey SQL Server 2000 3 November 22nd, 2004 11:05 PM

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