Code Examples
  Home arrow Code Examples arrow Implementing ASP into WML code using dynam...
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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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? 
CODE EXAMPLES

Implementing ASP into WML code using dynamic data from MSAccess.
By: aspfree
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 21
    2000-07-28

    Table of Contents:

    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


    Create dynamic WAP pages with WML and ASP - By Michael Wright

    In my last set of articles I told you how to getstarted with WML and gave a brief explanation of how ASP can beimplemented into WML code. Please read these articles before this oneby going to http://www.aspfree.com/authors/michaelw/wap/default.asp.This article will give examples of implementing ASP into WML code andshow you how to make your WAP site change as your normal website doesevery time you update your MS Access databases.

    So, you have created your WAP site and have started updating itevery time you update your regular website but it’s just taking so longto do. One of the easiest ways to update a website is to make itdynamic so that when you update one element of the site another thingchanges in conjunction with it. For example, if you were to create anews section within your website you could have a start page displayingthe headlines, which if the user clicked a headline another page woulddisplay the whole article. All the data would be grabbed from adatabase with simple fields like ID, Date, Headline and Article.

    Now, if you can create a HTML/ASP version ofthe above then it’s relatively simple to create a WML/ASP version. Ifyou do not know how to create a HTML/ASP version of the above then youshould learn that first by going to http://www.aspfree.com/demos.asp and check out the ASP-DATABASE section. To view a live version of a news section please go to http://www.vetsonline.com/html/news.htm.

    Below is an example of how to create the WML/ASP version (you shouldchange all the words in the ASP code in Red where appropriate):

    <% Response.ContentType = "text/vnd.wap.wml" %><?xml version="1.0" encoding="iso-8859-1"?>

    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

    <wml>

    <!-- THIS IS THE MAIN CARD OF THE DECK -->

    <card id="MainCard">

    <p align="left"><small><b>NEWS STARTPAGE WAP EXAMPLE </b></small></p>

    <%

    strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("LOCATION OF DATABASE")

    set conn = server.createobject("adodb.connection")

    conn.open strconn

    set rs = server.createobject("adodb.recordset")

    QueryDate = "July 2000" 'enter this months date or for daily news, todays date e.g. Date()

    Query = "Select * from DATABASE TABLE Where FIELD NAME LIKE '%" &QueryDate &"%' ORDER BY id"

    rs.open Query, conn

    if not rs.eof Then

    rs.movefirst

    Do While NOt Rs.EOF

    id = rs("id") 'read each id as it displays the headlines

    %>

    <p align="left"><small><anchor><%=rs("Headline")%><go href="ASP PAGE TO VIEW ARTICLE.asp?id=<%=id%>"/></anchor></small></p>

    <%

    rs.movenext

    Loop

    else

    response.write("<p align='left'><small>There are no news articles this month as yet.</small></p>")

    End if

    ' close everything

    rs.close

    Set conv = nothing

    set rs= nothing

    set conn = nothing

    %>

    <p align="left"><small><a href="PREVIOUS PAGE ">Back</a></small></p>

    </card>

    </wml>

     

    You must now create the WML/ASP page to display the actual articleswhere you are linking the Headlines. Below is an example of this:

     

    <% Response.ContentType = "text/vnd.wap.wml" %><?xml version="1.0" encoding="iso-8859-1"?>

    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

    <wml>

    <!-- THIS IS THE MAIN CARD OF THE DECK -->

    <card id="MainCard">

    <%

    id = Request.QueryString("id")

    dim conn

    dim rs

    dim strsql

    dim strconn

    strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("LOCATION OF DATABASE")

    set conn = server.createobject("adodb.connection")

    conn.open strconn

    set rs = server.createobject("adodb.recordset")

    Query = "Select * from DATABASE TABLE Where ID ="&id&" ORDER BY ID"

    rs.open Query, conn

    rs.movefirst

    Do While NOt Rs.EOF

    %>

    <p align="left"><small><b><%=rs("Headline")%></b></small></p>

    <p align="left"><small><%=rs("Article")%></small></p>

    <%

    rs.movenext

    Loop 

    close everything

    rs.close

    set rs= nothing

    set conn = nothing

    %>

    <p align="left"><small><a href="PREVIOUS PAGE">Back</a></small></p>

    </card>

    </wml>

    Now you can try out your WAP site and link the new news section toyour WAP site. The next time you change your database your WAP sitewill now change along with your regular website. One of the best thingsyou can do when creating WAP sites is to keep it simple and if you areworking with databases keep them simple. It is also best to test yourWAP code first before implementing ASP otherwise it will get confusing.

    I hope this article has been of some use to you all and in my next Iwill be showing ways of how to improve to above code to make it evenmore dynamic!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Code Examples Articles
    More By aspfree

     

    IBM® developerWorks developerWorks - FREE Tools!


    Be the first to hear about i5/OS V6R1!

    Hold your calendar on January 30, 2008 for this free webcast on the new i5/OS. Rational's Enterprise Modernization products will be discussed at this webcast as they help to drive the application development environment for this new System i OS. <br />And learn how i5/OS will take you to the next step of efficient, resilient business processing. You will hear about the new i5/OS capabilities as it will be the most significant i5/OS release in years. If you cannot join the webcast on 1/30/08 you can still use this link to listen to the replay.<br />
    FREE! Go There Now!


    IBM DB2 Deep Compression ROI Tool

    The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times.
    FREE! Go There Now!


    NEW! Achieving True Agility -- How process can change the behavior of your tools

    Achieving true agility is a never-ending effort. We will showcase how you can become agile incrementally, a few practices at the time.Which practices should any agile team strive to adopt? What additional practices should you consider based on your needs to scale? Adopting practices are however made much easier with the right tool support. What about if your tools adapt to your practices? We will take a look at how the Jazz technology can be leveraged to make your process change the behavior of your tools.
    FREE! Go There Now!


    NEW! Download IBM Rational Developer for System z

    Download a free trial version of IBM Rational Developer for System z, software that can help you deliver core development capabilities; the power of Java Platform, Enterprise Edition (Java EE); and rapid application development support to diverse enterprise application development teams. With comprehensive development tools to help create, deploy and maintain traditional enterprise and composite applications, Rational Developer for System z enables developers with different technical backgrounds to easily participate in important technology projects.
    FREE! Go There Now!


    NEW! Evaluate Rational Host Access Transformation Services (HATS) Toolkit V7.1

    Visit IBM developerWorks to download a free trial of the Rational Host Access Transformation Services (HATS) Toolkit. The HATS toolkit provides a set of plug-ins for the IBM Rational Software Delivery Platform to help you easily extend your legacy applications. HATS makes your 3270 and 5250 applications available as HTML through the most popular Web browsers, while converting your host screens to a Web look and feel and it also enables you to develop new Web, portal, and rich-client applications.
    FREE! Go There Now!


    NEW! IBM Enterprise Modernization Sandbox for System z

    IBM Enterprise Modernization solutions help organizations evolve core IT systems towards modern architectures and technologies—reducing the burden of maintenance and freeing up resources to develop new business requirements and capabilities. With the IBM Enterprise Modernization Sandbox for System z you can evaluate IBM Enterprise Modernization solutions focused on five key areas: Assets, Architectures, Skills, Processes and Infrastructures, and Investment. Each solution is based upon real customer experiences and offers a proven path to get you started with your modernization projects.
    FREE! Go There Now!


    NEW! IBM Rational Systems Development e-Kit

    As systems increase in complexity, communication between systems and software teams becomes more and more difficult. Now, there’s a way to improve product quality and communication.<br />Read the “Model Driven Systems Development” white paper to see how. Also included in this kit are more educational white papers, customer examples, tutorials, informative Webcasts, and best practices for designing, building and managing systems.<br />
    FREE! Go There Now!


    NEW! Rational Talks to You: Scott Ambler on being agile in a global development environment

    Join this Rational Talks to You teleconference on December 6 at 1:00 pm ET to participate in an agile application development discussion and get your questions answered on using IBM Rational Method Composer in a distributed environment.Get your questions answered!
    FREE! Go There Now!


    NEW! Webcast: Introducing the new Information Server and Solutions community: LeverageInformation

    User communities play an important role in communication and collaboration around products, solutions and other areas of special interest to members. Successful communities are able to provide the right mix of content and services to deliver a value proposition that resonates with each audience. Join Tom Inman, VP of Marketing for Information and Platform Solutions as he introduces the new LeverageINFORMATION community. During this webcast, learn about the value provided by the community and how customers and partners derive value from the community in addressing their own technical and business challenges.
    FREE! Go There Now!


    NEW! Webcast: What is new in Viper 2 for developers?

    Viper 2 brings a great value to developer communities including SQL, XML, PHP, Ruby, .NET and Java. You probably already know that DB2 Express-C is free for developers to develop, deploy and distribute. Viper 2 provides a variety of means that help move your application from the development stage to deployment more rapidly. This webcast shows how to best utilize the latest tools available for developing DB2 applications.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    CODE EXAMPLES ARTICLES

    - Bipartite Graphs
    - Connectivity in Graphs
    - The Ford-Fulkerson Algorithm
    - Critical Paths
    - The Bellman-Ford and Roy-Floyd Algorithms
    - Shortest Path Algorithms in Graphs
    - Minimum Spanning Tree
    - Articulation Edges and Vertexes
    - Circles and Connectivity in Graphs
    - Depth-First Search in Graphs
    - Breadth-First Search in Graphs
    - The Prufer Code and the Floyd-Warshall Algor...
    - An Insight into Graphs
    - Coding a Custom Object with WSC
    - Creating a Custom Object with WSC





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT