473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Call stored procedure from activex dll

I'm using code similar to the following in an asp page to call a
stored procedure that does a select on a SQLServer 2000 table:

dim rs, SelectSql
SelectSql = "EXEC spSelectStuff @param = '" & ParamValue & "'"
set rs = conn.Execute(SelectSql)
-- do some stuff with rs --
rs.close : set rs = nothing...
The SelectStuff procedure:
CREATE PROCEDURE dbo.spSelectStuff
@param INT
AS

BEGIN
SET NOCOUNT ON
SELECT colX, colY, colZ
FROM tblTableX
WHERE ID = @param
END

GO

Everything works very well in my asp page. But I've been reading about
COM and now I'd like to take it one step further and move the code
from my asp page into an active-x dll.

How do I run the stored procedure from the dll?

Jul 19 '05 #1
7 2252
> Everything works very well in my asp page. But I've been reading about
COM and now I'd like to take it one step further and move the code
from my asp page into an active-x dll.
For what benefit?
How do I run the stored procedure from the dll?


Really not that much different, except you'll be using VB instead of
VBScript, I assume.
http://msdn.microsoft.com/library/en...l/404track.asp

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #2
Porting any VBScript to a VB DLL is a straightforward process and has been
covered ad-nauseum in this and other newsgroups - a Google groups search
should help you out. What you're going to start asking though, are questions
about the architecture of the components that tend to grow out of this
work - business logic layer components, data access layer components, etc.
Look at a book called ASP.NET Website Programming - Problem, Design,
Solution, by Wrox. The authors build a website based on a tier and silo
architecture that I thought illustrates many useful concepts. The concepts
can be back-ported to VB/COM and this will give you some insight into one
way of designing and building these multi-tier architectures.

Alan

"Luis" <an****@webmail.co.za> wrote in message
news:vd********************************@4ax.com...
I'm using code similar to the following in an asp page to call a
stored procedure that does a select on a SQLServer 2000 table:

dim rs, SelectSql
SelectSql = "EXEC spSelectStuff @param = '" & ParamValue & "'"
set rs = conn.Execute(SelectSql)
-- do some stuff with rs --
rs.close : set rs = nothing...
The SelectStuff procedure:
CREATE PROCEDURE dbo.spSelectStuff
@param INT
AS

BEGIN
SET NOCOUNT ON
SELECT colX, colY, colZ
FROM tblTableX
WHERE ID = @param
END

GO

Everything works very well in my asp page. But I've been reading about
COM and now I'd like to take it one step further and move the code
from my asp page into an active-x dll.

How do I run the stored procedure from the dll?

Jul 19 '05 #3
On Mon, 14 Jun 2004 15:36:57 -0400, "Aaron [SQL Server MVP]"
<te*****@dnartreb.noraa> wrote:
For what benefit? The code contains some fancy calculations that are performed on the
data that is obtained from the database and I'l like to "protect"
those calculations.

Also, apparently "Compiled code is known to be more efficient than
interpreted code".
Really not that much different, except you'll be using VB instead of
VBScript, I assume.
http://msdn.microsoft.com/library/en...l/404track.asp


Thanks, that was a useful article!
Jul 19 '05 #4
> Also, apparently "Compiled code is known to be more efficient than
interpreted code".


Yes, that article was written back in 1999. Much more extensive tests has
been run since then, and I've tried to get the statement corrected.

A
Jul 19 '05 #5
On Tue, 15 Jun 2004 14:37:42 -0400, "Aaron [SQL Server MVP]"
<te*****@dnartreb.noraa> wrote:
Yes, that article was written back in 1999. Much more extensive tests has
been run since then, and I've tried to get the statement corrected.


Are you saying that the statement is incorrect - i.e. that compiled
code is NOT faster than interpreted code?
Jul 19 '05 #6
If your wanting to protect the code, why not just store the file outside of
the webroot, and use the include in the page that uses it?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Luis" <an****@webmail.co.za> wrote in message
news:ha********************************@4ax.com...
On Mon, 14 Jun 2004 15:36:57 -0400, "Aaron [SQL Server MVP]"
<te*****@dnartreb.noraa> wrote:
For what benefit?

The code contains some fancy calculations that are performed on the
data that is obtained from the database and I'l like to "protect"
those calculations.

Also, apparently "Compiled code is known to be more efficient than
interpreted code".
Really not that much different, except you'll be using VB instead of
VBScript, I assume.
http://msdn.microsoft.com/library/en...l/404track.asp


Thanks, that was a useful article!

Jul 19 '05 #7
Luis wrote:
On Tue, 15 Jun 2004 14:37:42 -0400, "Aaron [SQL Server MVP]"
<te*****@dnartreb.noraa> wrote:
Yes, that article was written back in 1999. Much more extensive
tests has been run since then, and I've tried to get the statement
corrected.


Are you saying that the statement is incorrect - i.e. that compiled
code is NOT faster than interpreted code?


Without context, the statement is true: compiled code is faster than
interpreted code. However, this statement fails to consider other factors,
such as the time and resources to initialize the COM object, the time and
resources required to marshal data across processes, and the fact that code
execution speed is rarely the bottleneck during database access. Compiled
code waits just as long as interpreted code.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
3
by: Mariusz | last post by:
I want to write function to call another function which name is parameter to first function. Other parameters should be passed to called function. If I call it function('f1',10) it should call...
4
by: Jean-Marc Blaise | last post by:
Dear all, I have simulated the windows MULTI application with a java program calling the SQLTP1DL proc referenced as DB2DARI application, on Linux Intel or ZLinux. If the proc is NOT FENCED,...
6
by: Sam | last post by:
I had created stored procedure at SQL Server 2000 and how do I call it via ASP.Net using VB Language? CREATE PROCEDURE STK As if exists (select * from dbo.sysobjects where id =...
4
by: Pakna | last post by:
Hi, is there any way to call a JAVA stored procedure from a SQL Trigger? We are having difficulties with this and cannot verify whether DB2 even *has* this capability? Thank you very much....
1
by: Alex | last post by:
Hello, I have a stored procedure that processes an individual file from a directory and archives it in a subdirectory.Now, the problem is, when i execute it , it will only process one file. What...
3
by: mandible | last post by:
I'm trying to call one stored procedure inside another. I was wondering if this is possible Some ideas I was toying with is putting the first stored procedure inside of a temp table but haven't...
2
by: savio XCIX | last post by:
I created the following stored procedure: ======= CREATE PROCEDURE TBLNAME.proc_test (IN p_custnum VARCHAR(8), IN p_zipcode...
12
by: barmatt80 | last post by:
I don't know if this is the right part of the forum. But.... I have been working all night trying to create a web service to call a stored procedure in sql server 2008. The stored procedure calls...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.