Wrox Programmer Forums
|
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
 
Old November 3rd, 2004, 04:43 PM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to kasejust1993
Default help with com object

I have a simple vb dll

Function getNames(strSubscriber As String)
    strSQL = "SELECT first_nm, last_nm from tbl_member where subscriber_id = '" & strSubscriber & "'"

strConnection = "DSN=BCI5"

'Set Cnxn = New ADODB.Connection
Cnxn.Open strConnection
rs.Open strSQL, Cnxn, adOpenStatic, adLockReadOnly, adCmdText
getNames = rs

End Function

and I am trying to get the asp to call the object and return the record set


strSSN = "98989898"


Set ComObject = Server.CreateObject("MEDSUP.SUP_ENROLLMENT")



Set rs = ComObject.getNames(cstr(strSSN),"")

rs.open
if not rs.eof then
    while not rs.eof
        Response.Write rs("first_nm") & "<BR><BR>"
        rs.movenext
    wend
else
    Response.Write "None Found"
end if

I keep getting a Wrong number of arguments or invalid property assignment: 'ComObject.getNames' error

any help would be appreciated



 
Old November 3rd, 2004, 05:35 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;; strSQL = "SELECT first_nm, last_nm from tbl_member where subscriber_id = '" & strSubscriber & "'"

Is the subscriber_id field an integer or a string?
The name of the field leads me to believe its an integer, if thids is the case you need to remove the single quotes like so:

strSQL = "SELECT first_nm, last_nm FROM tbl_member WHERE subscriber_id = " & strSubscriber & ""


Wind is your friend
Matt
 
Old November 5th, 2004, 06:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:
Function getNames(strSubscriber As String)
...
Set rs = ComObject.getNames(cstr(strSSN),"")
The function only takes one parameter but you are trying to pass two...





Similar Threads
Thread Thread Starter Forum Replies Last Post
object reference not set to instant of an object shahidrasul ASP.NET 2.0 Basics 1 September 5th, 2008 02:01 PM
Serializing Object Graph - Assigning Object to Jag venkat.kl C# 0 August 28th, 2006 10:39 AM
create a Line object ,Box object in CR at Runtime? thanhnt Pro VB 6 1 May 16th, 2005 06:51 AM
Error Occurred creating Report Object: Object does sa_moizatyahoo Classic ASP Professional 0 February 1st, 2005 10:29 AM





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