Problem accessing component from VB
-
Hai, I've a component registed in my system. When i call the component from the ASP page it works fine. When I create an instance of the same component in VB Application, I get the error, object variable or with block variable not set. The error comes in the 3rd line of my code which i have specified below: Dim Con_Getcon As New JBHRCom.GetConnection Dim Con_ObjDB As New ADODB.Connection Set Con_ObjDB = Con_Getcon.Connection Could anyone help me out as soon as possible. Thank you, Regards, K. Sripriya
-
Hai, I've a component registed in my system. When i call the component from the ASP page it works fine. When I create an instance of the same component in VB Application, I get the error, object variable or with block variable not set. The error comes in the 3rd line of my code which i have specified below: Dim Con_Getcon As New JBHRCom.GetConnection Dim Con_ObjDB As New ADODB.Connection Set Con_ObjDB = Con_Getcon.Connection Could anyone help me out as soon as possible. Thank you, Regards, K. Sripriya
It's pretty hard to give you a correct answer without knowing what kind of object JBHRCom is, but assuming that you stick to "talking" naming convention, GetConnection method returns an object of ADODB.Connection type. I would try something like this instead: Dim Con_Getcon As New JBHRCom Dim Con_ObjDB As New ADODB.Connection Set Con_ObjDB = Con_Getcon.Connection