Results 1 to 2 of 2

Thread: COM and ASP

  1. #1
    Noorie Guest

    Default COM and ASP

    I&#039m a starter in learning COM. I have created a simple component in VB and registered it on the server using regsvr32.exe. I am calling it from ASP Page and I am getting this error. <BR>Is Object : True<BR>Object is Nothing : False <BR>p1 error &#039 800a01a8&#039 <BR><BR>Object required <BR><BR>/noorie/testcom1.asp, line 12 <BR><BR><BR>ASP Code :-<BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;%<BR><BR>Set Myobj=Server.CreateObject("p1.c1")<BR><BR>Response .Write "<BR>Is Object : " & IsObject(MyObj)<BR>a= Myobj is Nothing<BR>Response.Write "<BR>Object is Nothing : " & a<BR><BR>Myobj.insert 1,"test"<BR><BR>%&#062;<BR><BR>DLL CODE:-<BR><BR><BR>Public Sub Insertrec(TID as Integer, TName as String)<BR><BR>Set Con=Server.CreateObject("ADODB.Connection")<BR><BR >Con.Open ("DSN=TempDB")<BR><BR>Con.Execute("Insert into temp values(" & TID & ",&#039" & TName & "&#039)")<BR><BR>End Sub<BR><BR>The same code directly written in ASP page is working. Can anybody help?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: COM and ASP

    The problem is that you are using Server.CreateObject, but becuase you&#039re inside a dll you do not have a reference to the Server object.<BR><BR>You can just use CreateObject, but you should read up on ObjectContext as well (ObjectContext can get you references to ASP intrinsic objects)<BR><BR>Dunc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts