Microsoft Access
  Home arrow Microsoft Access arrow Page 3 - Working with Access Projects in Access 200...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MICROSOFT ACCESS

Working with Access Projects in Access 2007
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2007-03-07

    Table of Contents:
  • Working with Access Projects in Access 2007
  • Creating an MS Access 2007 Project
  • Creating a Stored Procedure in the Project
  • Stored Procedure in SQL Server

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Working with Access Projects in Access 2007 - Creating a Stored Procedure in the Project


    (Page 3 of 4 )

    With the database objects added you will be able to find the stored procedure icon in the Other section, right next to the Reports as shown here.

    ;

    Clicking on the Stored Procedure Icon, you will be able to create a New Object, a stored procedure.

    This opens the Add Table window where you can add one or more tables (use the shift key) to the fashioning of your stored procedure which uses a Query Editor.

    When you close the above window after choosing the table or tables, the objects will be added to the design pane. This works very much like the query editor in other, older versions of MS Access. You can pick the columns you want, sort them and order them and impose constraints to filter rows using criteria. Right clicking an empty area in the design pane lets you access the Grouping option as well as a few other tasks you can do as shown.

    We will be developing a stored procedure which asks for the name of a city and displays related information for that city. What was typed in was a question mark(?) in the criteria column  which becomes =@Param1, the parameter for a search query.

    When you right click the design area you can access the Properties window for this stored procedure as shown.  You can choose to display all columns or the chosen ones; you may, if you want, choose to show only distinct values; and so on. Choices made here will go into a stored procedure SQL script as seen later. The description is optional.

    If a Default is chosen for the @Param1 as shown in the Stored Procedure Parameters tab, then the stored procedure takes a hard coded value for the parameter and displays just the selected columns for that procedure.

    The Data tab can be used while scripting a stored procedure which depends on multiple tables with Master/Child relationships.

    Before you see the results of the procedure you need to save the procedure.

    The stored procedure is saved as ByCity in the project.

    When you click on the OK button the stored procedure will be saved and it immediately appears under the All Access Objects window as shown under Queries.

    If you right click the query named ByCity, you will pop open a drop-down where you can see the design view.

    When the query is highlighted using the View drop-down you can access various views, one of which is the SQL View. When this is chosen, a tab opens with the SQL script of the stored procedure. This SQL appears to be the case when the default city Bern was chosen. You can alter this SQL by removing =N'Bern' and reverting back to the parameterized query where you need to provide a parameter at run time.

    When the SQL View is chosen you can access other related icons for task management as shown in the next picture, like Verifying SQL Syntax, running the procedure, and so on.

    You may also right click on the tab of the tabbed window and access the various views as shown.

    With the parameterized version, if you "run" the procedure you will be asked for a parameter in the Enter Parameter Value box.

     

    When you enter "London" for the city and click on the OK button you will retrieve the columns for the "City" filter as shown.

    More Microsoft Access Articles
    More By Jayaram Krishnaswamy


       · You will learn to create an Access project using the latest version(the article was...
       · i hope somebody will send me how to learn ms access..thanks..i really need...
     

    MICROSOFT ACCESS ARTICLES

    - Linking SQL Express 2005 Tables to MS Access...
    - Working with Access Projects in Access 2007
    - Exploring Access 2007
    - Working with Stored Procedures in an MS Acce...
    - Creating and Using Action Queries
    - Creating Data Access Pages with Charts using...
    - Advanced Ideas using VBA
    - VBA Details
    - Updating Records in MS Access
    - Using ADO`s Record Object with URLs
    - Exporting XML from MS Access 2003
    - Importing XML into MS Access 2003
    - On Using Pass-through Queries in MS Access
    - Distributed Queries in MS Access
    - Configuring a Linked Microsoft Access Server...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway