47,549 Members
6 added today
482,686 Resources
1,228 added today

All Devdex   All Gurus  

HDML with ASP
Author: Dan Pitu
Rating:
Visits: 5488

26_source_and_db.zip
Discuss in Newsgroups

Page:

HDML with ASP - starting the WML adventure

Dan Pitu

This article is for the beginners and its goals is to provide some advice for you to avoid some general problems which can occur during the first phase of WAP development.

I will consider you have already installed a simulator. Let's say you have SDK 4.1 from OpenWave: http://developer.openwave.com/download/

Once you can access this UP. Simulator you have already made the first step.  What's next?  Don't forget: Start-Programs-UP.SDK 4.1-UP.Simulator Do you have it? Ok!

Having 2 tables in an Access database: Persons and Profession, you will see a kind of master detail structure implementing for WAP. So let's put some ASP code to work for us. Classic ADO connection, some links and parameter transmission between 2 pages will be all what we need. Assuming the MIME types are properly configured on your computer (it isn't the goal of this article) let's have a look at the code of persons.asp :

<!-- persons.asp -->

<!-- WARNING

if you copy/paste this code, my advice is to inspect it, especially on double quota (") char

-->

  

<% 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>

<!-- MAIN CARD-->

 

<card id="PersonsCard">

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

 

<%

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

set conn = server.createobject("ADODB.Connection")

conn.open strconn

 

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

 

Query = "Select * from persons"

rs.open Query, conn

 

if not rs.eof Then

rs.movefirst

Do While NOt Rs.EOF

idProf = rs("idProf")

%>

 

 <p align="left">

<small>

            <anchor><%=rs("LastName")%>

            <go href="profession.asp?idProf=<%=idProf%>"/>

            </anchor>

</small>

</p>

 

<%

rs.movenext

Loop

 

else

            response.write("<p align='left'><small>No one here.</small></p>")

End if

 

rs.close

Set conv = nothing

set rs= nothing

set conn = nothing

%>

 

</card>

 

</wml>

 

 <!-- End persons.asp>

How does it look like? Something like this:

 

 

Afterwards you can see profession.asp which is, of course a kind of detail page for the previous one.

 

 


Next Page >>

Visitor Comments

Anonymous User First article? This was great to look at this typ...

 

Rate this Article







	
	
	



ASP.NET Chart Control.
Charts from your Database.
Live Demo & FREE Trial!

ASP ArticlesThis category has been added to your weekly newsletter
ASP Web Sites
ADSI & WSH BooksThis category has been added to your weekly newsletter
FREE ComponentsThis category has been added to your weekly newsletter
ASP EventsThis category has been added to your weekly newsletter
ASP HeadlinesThis category has been added to your weekly newsletter

CSharp ArticlesThis category has been added to your weekly newsletter
C# Web SitesThis category has been added to your weekly newsletter

SQL ArticlesThis category has been added to your weekly newsletter
SQL Events
SQL HeadlinesThis category has been added to your weekly newsletter
SQL Jobs

Jobs in CaliforniaThis category has been added to your weekly newsletter

XML ArticlesThis category has been added to your weekly newsletter
XML BooksThis category has been added to your weekly newsletter
XML Web Sites
XML Tutorials

free asp host

"Alex Homer"This search has been added to your weekly newsletter

Edit My Favorites Edit Profile & Favorites

Web Programming

 




Developersdex Home | ASP | C# | SQL | VB | XML | Gurus
Add Your Link | Add Your Code | FAQ | Advertise | Link To Us | Contact Us |
Copyright © 2009 Developersdex™. All rights reserved.