Author: Michael Gonzalez
Frequently Answered Questions
Miscellaneous

File Text Search & Replace Utility
HTML Text Extraction using innerText
E-mail (CDONTS.NewMail) Sample Code
SQL Server 7.0/2000

Incorporating ASP and SQL Server
100's of T-SQL Scripts
Don't Use @@ERROR with UPDATE Statements
Exporting Tables to Text Files
Creating SQL Server Databases
ASP (SQL) Query Analyzer
Increasing SQL Server Performance with Indexes
Distributed SQL Server Transactions & Queries
COM/COM+ Development
What is COM?
Isn't ActiveX and COM the same?
How can Components benefit my ASPs?
Am I using COM Components now?
How do I use COM Components in my ASPs?
Creating your First COM Component
Creating a COM Component that uses ASP Intrinsic Objects
Creating a COM Component to access an MS-Access Database
MTS Component Template
MSMQ Component Template / Example

Microsoft Message Queue (MSMQ) Component Template/Example

Directions:
  1. Make sure MSMQ is installed on the same machine as your IIS4/5 server. You can install it from the NT Option Pack or, if using Windows 2000, go to Start\Programs\Administrative Tools, click on Configure your Server, click on the Advanced link, then click on the appropriate installation link. You do not need to install an Enterprise/Public version of MSMQ to make this example work - choose an Independent Client installation instead (if you don't already have it installed that is).
  2. Open VB6, start a new ActiveX DLL project, copy and paste the VB6 code below into the code window, click on Project\References..., click on the checkbox next to Microsoft Message Queue 2.0 Library, click on OK, change the Project name to MTGMSMQ, change the Class name to MessageQueues, click on File\Make MTGMSMQ.DLL..., choose a location where to save your component, click on OK, then register your component using REGSVR32 C:\Path\MTGMSMQ.DLL or add it to an MTS Explorer Package or Application.
  3. Copy and paste the ASP code below into an ASP page named msmq.asp and store it into a virtual directory that your IIS server can execute.
  4. Your ready - just run the msmq.asp page.
What the Example Does:
  1. The Message and Queue name variables are declared and set (lines 1-3).
  2. The ASP page instantiates the custom component MTGMSMQ.MessageQueues (line 4).
  3. A new queue is created named testqueue (line 5).
  4. A message is sent to the queue (line 6).
  5. The message is read then written to the ASP page (line 7).
  6. The Queue is destroyed (line 8).
  7. The component object is destroyed (line 9).
ASP/VBScript Code for Example: VB6 MSMQ Component Template/Example:
Comments & Questions Form

Send It!