Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connection object is not returned
Message
From
09/04/2002 15:06:48
 
 
To
09/04/2002 08:19:59
General information
Forum:
Visual Basic
Category:
VBScript
Miscellaneous
Thread ID:
00642577
Message ID:
00642842
Views:
10
>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.


Not necessarily. I would put some error handling in the function and return the error number and description as the return value to see what's the exact nature of the problem. It could be that the IIS account does not have permissions to the MDB path.


>Please tell me wtz wrong in it.
>
>Please help ASAP
>Thank
>
>Shahid
Previous
Reply
Map
View

Click here to load this message in the networking platform