Solved

REGARDING DLL

Posted on 2002-04-04
6
148 Views
Last Modified: 2010-05-02
Dim con As ADODB.Connection
Dim res As ADODB.Recordset
Function Getname1(custid As Integer) As String
    Set con = New ADODB.Connection
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\joshi\vbcode\customer.mdb;Persist Security Info=False"
    Dim str As String
    str = "select Firstname + ' ' + Lastname from" & "cust where custid= " & custid
    Set res = con.Execute(str)
    Getname1 = res(0)
End Function


I HAD CREATED DLL OF ABOVE FILE AND I WANT TO USE GENTAME1
FUNCTION INTO OTHER PROJECT HOW TO ACCESS THIS FUNCTION.
i HAD CREATED,COMPILED AND REGISTERED THIS DLL INTO REGESTRY.ALL R WORKING PROPERLY.I CAN ADD THE DDL INTO ANOTHER PROJECT BUT NOT ABEL TO ACCEESS THE GETNAME1 FUNCTION.
IF ANY BODY CAN HELP ME THEN I WILL BE THAKFUL TO THEM.
0
Comment
Question by:vinky_j
  • 3
  • 2
6 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 50 total points
ID: 6918077
is the class public? is the function public?
0
 
LVL 4

Expert Comment

by:escheider
ID: 6918496
Good suggestions emoreau

Assuming you already have a reference to CustomerID that you are passing to your dll:


If you made a reference to your activex dll do the following:

Dim cmVarName as new dllname.classname
Dim PersonName as string

PersonName=cmVarName.getname1(CustID)

msgbox "Welcome " & PersonName

If you have not made a reference in your project to your activex dll do the following

Dim cmVarName as object
Dim PersonName as string

set cmVarName=createobject("dllname.classname")

PersonName=cmVarName.getname1(custid)

msgbox "Welcome " & PersonName

But you must do what emoreau has suggested first.

0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6985047
any progress?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 4

Expert Comment

by:escheider
ID: 6985988
Guess not emoreau.  
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7060627
This question appears to be abandoned. A question regarding it will be left in the Community Support
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.

The link to the Community Support area is:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7065775
Thanks, emoreau  for your help here.

I have finalized this question, and will monitor it for comments.

Moondancer - EE Moderator
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 102
vb6 connector to SQL Server 2 37
Modifying Conditional Format from VBA code 3 57
backup program with robocopy 6 23
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question