Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connection object is not returned
Message
De
09/04/2002 08:19:59
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
VBScript
Titre:
Connection object is not returned
Divers
Thread ID:
00642577
Message ID:
00642577
Vues:
41
I have created a COM componet in VB. I created a fuction "CreateCon"
which create a DB connection obect and return it. its code is as follow

'---Code
Option Explicit

Public Function CreateCon() As Variant

Dim con As ADODB.Connection
Set con = New ADODB.Connection
'Dim rs As ADODB.Recordset
'Set rs = New ADODB.Recordset

con.Open "Data Source=myPath\DBName.mdb; Provider=Microsoft.Jet.OLEDB.4.0;"

Set CreateCon = con
Set con = Nothing
End Function

'-----------------------------
After creating dll I call this COM component from ASP as given below

set conClass = server.CreateObject ("projectName.classNam")
set con = conClass.CreateCon

BUT

it gives following error
"Arguments are of the wrong type, are out of acceptable range, or are inconflict with one another "

which mean connection object is not created.
Please tell me wtz wrong in it.

Please help ASAP
Thank

Shahid
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform