Solved

Writing COM+ Application using Visual Basic

Posted on 2002-05-13
4
212 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 50 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

691 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