?
Solved

Writing COM+ Application using Visual Basic

Posted on 2002-05-13
4
Medium Priority
?
217 Views
Last Modified: 2013-11-25
Hi,
     Can i have some guideline regarding how to use stored procedure (MS SQL Server 7.0) in VB coding (writing the .dll file)??? How to return the recordset after execute the related stored procedure???
     Can COM+ communicate well with stored procedure in MS SQL Server 7.0??
     Thanks for ur help.

Rgds,
sityee
0
Comment
Question by:sityee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
mdougan earned 150 total points
ID: 7005939
Here is the best reference I've found on-line for COM+ application guidelines for VB.  I followed these very carefully and had great success.

Yes, COM+ components have no trouble connecting to SQL Server and running stored procedures.  The only thing you have to decide is how you want to handle security.  We had our component read in a connect string during initialization, and this allowed us to change databases without having to recompile the application.  Then, we just set up one database user that the component would log in as.

If you're using COM+ make sure not to put any transactional logic in your stored  procedures (no Begin Transaction, Commit Transaction etc.).  All of that should be left to the transaction manager through SetComplete, SetAbort statements issued by your component.

We made all of our calls to our middle-tier components (and thus to the database) "stateless", meaning that we called a method in the component, and it didn't rely on any data (state) being saved from previous calls to the component.  Each method call would vote to either SetComplete or SetAbort the transaction.

If you need an example of making an ADO query to return a recordset let me know.  Oh, one other thing, Recordsets are kind of big objects to be passing from one tier to another tier, so, what we'd done is save the recordset out as an XML string (using the Recordset's Save method) and then passed back the XML string to the client Front End.  This was much faster than passing back a recordset.

Try to design your COM+ components so that all of the parameters that you pass to the methods in those components are pass ByVal, because there is a lot of overhead involved if you pass something to a COM+ component ByRef (which is the VB default)
0
 
LVL 5

Expert Comment

by:raizon
ID: 7006026
listening
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question