About
 
ASK THE AUTHOR       
Send FMStocks 2000 questions to the author, Scott Stanfield.
For FMStocks.NET, contact Microsoft
 

Questions asked about FMStocks 2000

Real Questions from Developers Using FMStocks

Last updated on April 22, 2004

The following are culled from your emails and feedback at trade-shows & conferences. We'll continue to add intriguing and valuable questions as they come in- If you have any questions or comments for Vertigo, use the blue box to the right. (Due to the number of emails, we can't guarantee immediate response.)

Questions


Q: Who is Fitch & Mather?

Q: What's the biggest difference between FMStocks 1.0 and FMStocks 2000?

Q: How do I run FMStocks 2000 on my computer?

Q: Does FMStocks 2000 work with MS SQL Server 2000?

Q: Does FMStocks 2000 work with MS SQL Server 7.0 SP4?

Q: How do I change the database server FMStocks is using?  

Q: Does FMStocks 2000 work with Windows Server 2003?  

Q: What's this Run SQL option on my menu?

Q: How do I disable the Run SQL option?

Q: Login Error: "An error occurred while trying to access the database."

Q: Is it possible to step into (debug) the VB component when it is called from ASP?

Q: Why doesn't FM Stocks use the ASP Session object?

Q: Is it possible to obtain the Homer scripts from you to stress test the setup we have here for the Win 2K demo?

Q: Why do you use the parameter "retval" instead of the intrinsic RETURN_VALUE to return success values for your stored procedures?

Q: Why don't you use explicit transactions in your stored procedures?

Q: Where is the source code for the Oracle DAL?

Q: Why would using the "mp" and "collectparams" functions be preferred over simply building an " EXEC " string?

Q: Isn't it dangerous to give end users your SQL server UserID and Password?

Q: Why isn't my Shopping Cart being emptied?

Q: How do I configure the sample for 3 different machines?

 
 

Q: Who is Fitch & Mather?

A: Fitch & Mather is one of the many fictitious names that Microsoft owns and uses for sample code. Other companies include the Northwind Traders, Duwamish Books, and Volcano Coffee Company.

Top


 

Q: What's the biggest difference between FMStocks 1.0 and FMStocks 2000?

A: FMStocks 1.0 was designed to run on Windows NT 4.0. We ported the site to run on Windows 2000 and to taked advantage of features in COM+. FMStocks 1.0 will run unchanged on Windows 2000. FMStocks 2000 includes a simple bookstore feature to illustrate how you would store complex state in the database.

Top


 

Q: How do I run FMStocks 2000 on my computer?

A: You'll need Windows 2000 Professional, Server or Advanced Server and Microsoft SQL Server 7.0. If you want to recompile the source code, you'll need Visual Basic 6.0. All the requirements are described in the setup document.

Top


 

Q: Does FMStocks 2000 work with MS SQL Server 2000?

A: Yes, FMStocks 2000 runs perfectly with either MS SQL Server 7.0 or MS SQL Server 2000. However, to install FMStocks 2000 onto MS SQL Server 2000 without making many changes to the install scripts, there is one condition you must meet. MS SQL Server 2000 must be installed without an alias. For machines with an existing MS SQL Server 7.0 installation, you must remove MS SQL Server 7.0 first, or upgrade/replace it with MS SQL Server 2000.

Top


 

Q: Does FMStocks 2000 work with MS SQL Server 7 SP4?   

A: Yes, FMStocks 2000 runs perfectly with either MS SQL Server 7.0 SP4. While FMStocks hasn't been extensively tested, there are no known issues with this configuration.

Top


 

Q: What's this Run SQL option on my menu?

A: The Run SQL option is a way for users to execute SQL statements directly against the FMStocks database. You can use it to view the content of a table or check for a particular record in a table. The Run SQL page is meant as a debugging tool only. You should not deploy it on a machine that has access to important data, as it can be used to query other database, or execute other SQL commands.

If you're not comfortable with having the Run SQL option, you can disable it with the instructions below.

Top


 

Q: How do I disable the Run SQL option?

A: You have to do two things. First, remove or rename the _RunSQL.asp file to something else so that IIS would not execute it when requested (_RunSQL.txt for instance).

The other thing that you would want to do is to remove the link to _RunSQL.asp from the t_begin.asp file.

Top


 

Q: When I log in on the initial screen, I receive the following error message:

An error occurred while trying to access the database. Please contact your systems administrator.

A: Ensure that the Core COM+ Application is set as a Server Application in the Activation tab. There is a note in the setup docs about this issue with RCs of Windows 2000.

Top


 

Q: When I try to debug a registered component, I receive a can't create object or access denied error message when the component is running within the VB IDE. Is it possible to step into the VB component when it is called from ASP? If so, what do I need to do?

A: Due to differences in security contexts between the ASP runtime and the VB IDE debugging session (where the component is created), disable anonymous access to the web site while debugging. This causes the ASP runtime to run in the same security context as the debugging session - forcing user login to access web pages. There are other ways to change the security context of the objects involved, but this is the easiest and simplest to describe.

Top


 

Q: Why doesnt FM Stocks use the ASP Session object?

A: To meet design goals, we didn't use ASP Session objects. We wanted a stateless web tier and to support a single machine failure at any physical tier in the architecture, which means using more than one web server. ASP Session object stores that information on a specific web server; if that web server dies, all state for users on that machine disappears. At best those users would have been forced to log in again; at worst those users may have lost work or other important information.

Also, if we had used the ASP Session object, we could not have used the ISAPI security filter that removed the need for cookies all together.

Note: The ASP Session object uses cookies to track clients

Top


 

Q: Is it possible to obtain the Homer scripts from you to stress test the setup we have here for the Win 2K demo?

A: We used RSW Software's e-LOAD for generating the test load. We did not use Homer to generate the load.

Top


 

Q: Is there a reason why you created the parameter "retval" and used that to return success values for your stored procedures instead of the intrinsic RETURN_VALUE of the stored procedure? Also for single selects that return integers, why not just return the integer as the return value of the procedure? What about stored procedures that only return an @@IDENTITY value?

A: The return value of a stored procedure can only be an integer. We used an output parameter called @retval because it is very noticeable, and is easy to use from a command object. It also allows you to return any data type, like a string.

Top


 

Q: I see that you don't use explicit transactions in your stored procedures. Is it a mistake to do this?

A: There is nothing wrong with using explicit transaction in SQL code. In our sample we used COM+/MTS to manage all our transactions. We wanted to show how to take advantage of COM+/MTS transaction support without having to write any code in T-SQL, or directly via ADO in your components. It's quite a bit easier to enable and use transactions by setting COM+/MTS properties that then cause transactions to occur. You can also use the same objects with Oracle, or across multiple databases, to enforce distributed transactions via the Distributed Transaction Coordinator (DTC), which COM+/MTS employs.

Top


 

Q: I cannot find the source code for the Oracle DAL anywhere on fmstocks.com or MSDN. Can you please advise me as to where I can find it?

A: The source code for the Oracle DAL is still available Microsoft's MSDN site, or on the MSDN Library: http://msdn.microsoft.com/vstudio/centers/scale/fmstocks.asp

Top


 

Q: When it comes to passing in parameters to stored procedures from business objects, I understand you are using the mp and collectparams functions. Can you explain why this is preferred over simply building a string with " EXEC ", the name of the stored procedure, and any parameters, and execute it against a connection as opposed to using the command object?

A: That method works for some cases, but not for others. The main differences with the two methods really come down to the differences between using a command object or not.

Without a command object you have the following problems/issues:

1) One must be careful about how you would build the execute string, paying special attention to the data types and escaping for strings and other data types.
2) Secondly, how would you return output parameters or return values if you dont use a command object?

Top


 

Q: Isn't it dangerous to give end users your SQL server UserID and Password? In the VBA application, users can download to view their portfolio offline and can easily open the VBA and see the code in the common module. Even if the application retrieved the connection string dynamically, nothing would keep a hacker from inserting a break point in the VBA code and returning the connection string to the SQL database including SQL user id's and passwords

Since your I/O stream is real time in VBA I do not see how this could be prevented. A better approach may be to generate the XLS file server side, perhaps using XML and then send the finished file to the client.

A: We removed that function from the code and it is no longer used. All information is now retrieved from the web servers through ASP pages that return XML data objects. Even the VBA code strictly enforces the 3(+) tier approach. The VBA code never goes directly to the database, or even has access to it.

Top


 

Q: Why isn't my Shopping Cart being emptied?

A: In some automated setup installations, the Event that triggers order processing doesn't get enabled (due to the design of the automated component installation). The MSI package (containing the components), and COM+ setting, should have the Subscription enabled. (so what does somebody do? manually install?)

Top


 

Q: How do I configure the sample for 3 different machines: IIS; MTS (App Server); SQL. Do I need to create any stub dll's in VB?

A: You do not need to create any stubs in VB.

I assume you have already setup two machines, a web server and your sql server. To get the App server in the mix, install the components on the App server. Then export the "FMStocks Core" COM+ Application as a proxy. Next, Remove the "FMStocks Core" COM+ Application from the web server and install the msi from the export on the app server. This will cause the web server to use the App server anytime those components are created.

Now you have a physical 3-tier architecture.

Top


 

Q: How do I change the database server FMStocks is using?

A: You need to use object construction on one of the COM+ Components.

To make the change, open Component Services from Administrative Tools (which is either in Control Panel or on the Start Menu). Expand the tree until you have the FMStocks_DB.DBHelper component selected as shown below:
Component Services of FMStocks

Right-click and select Properties. Click on the Activation tab. Select the Enable object construction checkbox. Input a connection string to your database. Here is an example:

ConnectionString=Provider=SQLOLEDB;Data Source=YourDatabaseServer;User Id=stocks_login;Password=password;Initial Catalog=stocks
NOTE: The password above is the default, we recommend that the password is changed to a strong password.

Here is an example screenshot of the Properties dialog box:
FMStocks_DB.DBHelper Component Properties

Top


 

Q: Does FMStocks 2000 work with Windows Server 2003?

A: Yes FMStocks 2000 works with Windows Server 2003.

FMStocks 2000 has been tested with Windows Server 2003 and works fine, even with the native IIS 6 process model.

Top


 

Copyright © 1999-2007 Vertigo Software, Inc.