Results 1 to 3 of 3

Thread: ActiveX and ASP connections

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Hi I need to know what to refrence, change, or include in my ActiveX component to make it connect to the same serverObject as the rest of my ASP page and pages. I'm getting "object required" using the same ASP code. Any one know how to do this? Here it is:


    Dim Connect4, Query4, a, b, c, d, f, g, h, j, k, l, m, v, DataValue (100 )
    Set Connect4 = Server.CreateObject("ADODB.Connection")
    Connect4.Open "NewSite"
    Set Query4 = Connect4.Execute("Select * from Tracking")

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Are you talking about using the same connection across all ASP pages? If yes, then you can store your Connection object in a Session.

    First Page
    Code:
    <%
    
    Dim rs
    
    Set Session("objConn") = Server.CreateObject("ADODB.Connection")
    Session("objConn").Open "DSN=DSNName;UID=UserName;PWD=Password"
    
    Set rs = Session("objConn").Execute("Select * From TableName")
    
    'Do recordset operations here
    
    Set rs = Nothing
    %>
    Second Page
    Code:
    <%
    
    Dim cm
    
    Set cm = Server.CreateObject("ADODB.Command")
    
    'Execute stored procedure
    With cm
        .ActiveConnection = Session("objConn")
        .CommandType = 4    'adCmdStoredProc
        .CommandText = "StoredProcName"
        .Execute
    End With
    
    Set cm = Nothing
    
    %>

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Serge,

    As always, thank you so much.But what I'm trying to do is write an activeX chart-graphing control and trying to get to the data base directly from inside it as if it were an ASP page of it's own. I know I'm probably screwing up here somewhere, but now that I've challenged myself to do this I'm hoping an expert like yourself might be able to help me out.
    P.S. The session code is also helpful to me. Thanks.

    JoeyO.

Posting Permissions

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



Click Here to Expand Forum to Full Width