Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 August 17th, 2004, 01:35 AM
Registered User
 
Join Date: May 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB constructor

Dear frens,

i try to create an object using Class Module in vb.
however, just can figure out how to code the Constructor(with parameter) for the object. Can anyone pls kindly help me?

example:
==========
dim objName as objCreated
set objName=new objCreated(value1,value2)


thanks, :)
snowbelly.

 
Old August 17th, 2004, 08:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

are you working in vb 6 or vb .net???

HTH

Gonzalo
 
Old August 18th, 2004, 04:42 AM
Registered User
 
Join Date: May 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am working in VB6

anyway,1 of my fren told me tat there is no such thing as constructor in VB6..so i hv continue it by coding another function to handle it. :)

however,i hv came across another problem...hehe..

---------------------------------------------------
dim adoRS As New ADODB.Recordset
adoRS.CursorType = adOpenDynamic
adoRS.LockType = adLockPessimistic

example 1:
=============
a = Array("ID", "address", "date")
b = Array("a", "b", "c")
adoRS.AddNew a, b


example 2:
============
dim a(2), b(2) As String
a(0) = "ID"
a(1) = "address"
a(2) = "date"
b(0) = "a"
b(1) = "b"
b(2) = "c"
adoRS.AddNew a, b
------------------------------------

i just can't get it, why example 1 can run but example 2 have error:
"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."

can any1pls kindly give some advice?

thanks,
snowbelly.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Constructor nayeem69 .NET Framework 2.0 1 July 17th, 2007 12:33 AM
Constructor ramess C++ Programming 1 March 18th, 2006 07:23 PM
constructor in servlets bondalapati98 Servlets 5 January 16th, 2006 12:27 AM
Constructor problem yengzhai C++ Programming 6 May 18th, 2005 11:05 AM
Constructor With a Default? n6532l Visual C++ 2 September 18th, 2003 02:16 PM





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