Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. ASP DLL PROBLEM....HELP!!!!

ASP DLL PROBLEM....HELP!!!!

Scheduled Pinned Locked Moved Database
helpsharepointdatabasecomsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I am having a problem with a server side component (DLL) i am developing for an ASP page. Im not really sure what the problem is. I tested the code in a vbproject and it worked perfectly but when I try it in an ASP page, it doesnt work. ************************************************************** My ASP page looks like this <%@ Language=VBScript %> <% dim obj set obj = server.CreateObject("Danny.Lopez") Response.Write(obj.GetTeam(1)) %>

    *************************************************************** This is the error im getting Error Type: Danny (0x800A01A8) Object required /Project1/Registration.asp, line 10 *************************************************************** This is some of the the code in my ActiveX DLL Public Function GetTeam(TeamID As Integer) As String Dim sql As String sql = "SELECT Name FROM Teams WHERE TeamID = " & TeamID GetTeam = ExecuteQuery(sql, True)(0) End Function Private Function ExecuteQuery(sql As String, Optional CloseConnection As Boolean = False) As ADODB.Recordset Dim state As Integer state = DataEnvironment1.Connection1.state If state = 0 Then DataEnvironment1.Connection1.Open End If Dim rs As ADODB.Recordset Set rs = DataEnvironment1.Connection1.Execute(sql) Set ExecuteQuery = rs If state = 0 And Not CloseConnection Then DataEnvironment1.Connection1.Close End If End Function *************************************************************** To make sure the DLL worked at all in the ASP page I created a simple function that takes a string and returns it. Public Function Repeat(str As String) As String Repeat = str End Function This function worked in an ASP pef *************************************************************** I feel the error has to do with the data types im passing to my DLL, but im not sure. Please Help!!!! Thanks Danny :((

    L 1 Reply Last reply
    0
    • L Lost User

      I am having a problem with a server side component (DLL) i am developing for an ASP page. Im not really sure what the problem is. I tested the code in a vbproject and it worked perfectly but when I try it in an ASP page, it doesnt work. ************************************************************** My ASP page looks like this <%@ Language=VBScript %> <% dim obj set obj = server.CreateObject("Danny.Lopez") Response.Write(obj.GetTeam(1)) %>

      *************************************************************** This is the error im getting Error Type: Danny (0x800A01A8) Object required /Project1/Registration.asp, line 10 *************************************************************** This is some of the the code in my ActiveX DLL Public Function GetTeam(TeamID As Integer) As String Dim sql As String sql = "SELECT Name FROM Teams WHERE TeamID = " & TeamID GetTeam = ExecuteQuery(sql, True)(0) End Function Private Function ExecuteQuery(sql As String, Optional CloseConnection As Boolean = False) As ADODB.Recordset Dim state As Integer state = DataEnvironment1.Connection1.state If state = 0 Then DataEnvironment1.Connection1.Open End If Dim rs As ADODB.Recordset Set rs = DataEnvironment1.Connection1.Execute(sql) Set ExecuteQuery = rs If state = 0 And Not CloseConnection Then DataEnvironment1.Connection1.Close End If End Function *************************************************************** To make sure the DLL worked at all in the ASP page I created a simple function that takes a string and returns it. Public Function Repeat(str As String) As String Repeat = str End Function This function worked in an ASP pef *************************************************************** I feel the error has to do with the data types im passing to my DLL, but im not sure. Please Help!!!! Thanks Danny :((

      L Offline
      L Offline
      Loki
      wrote on last edited by
      #2

      DanielLopez wrote: Public Function GetTeam(TeamID As Integer) As String Dim sql As String sql = "SELECT Name FROM Teams WHERE TeamID = " & TeamID GetTeam = ExecuteQuery(sql, True)(0) End Function Rewrite the above function as ... Public Function GetTeam(TeamID As Integer) As String Dim sql As String Dim rs as ADODB.Recordset sql = "SELECT Name FROM Teams WHERE TeamID = " & TeamID set rs = ExecuteQuery(sql, True) GetTeam = rs.Fields(0) End Function :) Grant @ Loki

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups