Print Page | Close Window

ASP in WML

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=14254
Printed Date: 30 March 2026 at 1:11pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP in WML
Posted By: pjb007
Subject: ASP in WML
Date Posted: 15 March 2005 at 2:12pm
Can anyone help, I want to make a database driven WAP page that just collects a list of headlines from the database.  I can't get this to work, can anyone see any errors in the below code?
 

<%@ Language = "JScript"; %><% Response.ContentType = "text/vnd.wap.wml";
%><?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
                &nbs p;    " http://www.wapforum.org/DTD/wml_1.2.xml - http://www.wapforum.org/DTD/wml_1.2.xml ">
<wml>
   <card id="card1" title="Testing">
      <p>
         Testing<br/>
<%
dim Conn
dim FilePath
dim SQL
Dim RsUser
'Connection to Database
Set Conn = Server.CreateObject("ADODB.Connection")
FilePath = Server.MapPath("db/database.mdb")
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & FilePath & ";"
'SQL Query String
SQL = "Select * FROM news ORDER By date"
'Set the Recordset
Set RSUser = Conn.Execute (SQL)
'Print the Recordset
RSUser.movefirst
Do while not RSUser.EOF
 
   Response.Write (RSUser("headline"))

RSUser.movenext
Loop

%>
      </p>
   </card>
</wml>
 
All that I can get to displat are the bits shown in bold.



Replies:
Posted By: dj air
Date Posted: 15 March 2005 at 2:20pm
im not the best with WML.
 but that looks ok, only thing that looks out of place is the

 "<%@ Language = "JScript"; %>"

have you tried it without that line, also make sure the content type command is correct, as number of times ive forgotten that section..LOL


Posted By: pjb007
Date Posted: 15 March 2005 at 2:44pm

I have replace that the code before the opening wml tab with

 

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
" http://www.wapforum.org/DTD/wml_1.1.xml - http://www.wapforum.org/DTD/wml_1.1.xml ">
 
Still does not work.


Posted By: dj air
Date Posted: 15 March 2005 at 2:58pm
are

Dim Conn dim FilePath dim SQL Dim RsUser

all on the same line within the file OR
is it just the WWF formatting done that

if it is like the aboe you need to only have one Dim then the veriables sepereated by a comma

so all you see is
title="Testing">      <p>         Testing<br/>

if you take the title out does it only show Testing that in shown on the right above?

if so then its a problem with the Title tag.

i take it your not trying to show records at present as they are commented out?


Posted By: pjb007
Date Posted: 15 March 2005 at 3:09pm
It is the formatting I will try and copy it in a line at a time below (the first few lines of this code are slightly different to the above)
 

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
" http://www.wapforum.org/DTD/wml_1.1.xml - http://www.wapforum.org/DTD/wml_1.1.xml ">
 
<wml>
   <card id="card1" title="Testing">
      <p>
         Testing<br/>
<%
dim Conn
dim FilePath
dim SQL
Dim RsUser
 
'Connection to Database
Set Conn = Server.CreateObject("ADODB.Connection")
FilePath = Server.MapPath("db/database.mdb")
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & FilePath & ";"
 
'SQL Query String
SQL = "Select * FROM news ORDER By date"
 
'Set the Recordset
Set RSUser = Conn.Execute (SQL)
 
'Print the Recordset
RSUser.movefirst
Do while not RSUser.EOF
 
 
 
   Response.Write (RSUser("headline"))
RSUser.movenext
 
Loop
 
 
%>
      </p>
 
   </card>
</wml>


Posted By: dj air
Date Posted: 15 March 2005 at 3:18pm
im not sure whats wrong but if this helps, this is a card from an example


<?xml version="1.0"?>

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

<wml>

<card id="no1" title="Card 1">

<p>Hello World!</p>

</card>

<card id="no2" title="Card 2">

<p>Welcome to our WAP Tutorial!</p>

</card>

</wml>



it is best to set the fields you want to get from the SQL, so News.titletext , not *


Posted By: pjb007
Date Posted: 15 March 2005 at 3:30pm
Here is a screen shot of the site in a WAP emulator.
 
screenshot showing what is displayed


Posted By: dj air
Date Posted: 15 March 2005 at 3:33pm
ok.. right im not sure but it maybe because your using a Set rsser = connExecute.

 not sure if thats rite or not as i haven't used it  before but it maybe because you haven't set the rsUser as a recordset



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net