|
-
Oct 18th, 2000, 12:37 PM
#1
Thread Starter
Hyperactive Member
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")
-
Oct 18th, 2000, 02:47 PM
#2
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
%>
-
Oct 18th, 2000, 08:21 PM
#3
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|