Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP in WML
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP in WML

 Post Reply Post Reply
Author
pjb007 View Drop Down
Groupie
Groupie


Joined: 03 September 2004
Location: United Kingdom
Status: Offline
Points: 185
Post Options Post Options   Thanks (0) Thanks(0)   Quote pjb007 Quote  Post ReplyReply Direct Link To This Post Topic: ASP in WML
    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">
<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.
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pjb007 View Drop Down
Groupie
Groupie


Joined: 03 September 2004
Location: United Kingdom
Status: Offline
Points: 185
Post Options Post Options   Thanks (0) Thanks(0)   Quote pjb007 Quote  Post ReplyReply Direct Link To This Post 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">
 
Still does not work.
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
pjb007 View Drop Down
Groupie
Groupie


Joined: 03 September 2004
Location: United Kingdom
Status: Offline
Points: 185
Post Options Post Options   Thanks (0) Thanks(0)   Quote pjb007 Quote  Post ReplyReply Direct Link To This Post 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"
 
<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>


Edited by pjb007 - 15 March 2005 at 3:22pm
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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 *

Edited by dj air - 15 March 2005 at 3:20pm
Back to Top
pjb007 View Drop Down
Groupie
Groupie


Joined: 03 September 2004
Location: United Kingdom
Status: Offline
Points: 185
Post Options Post Options   Thanks (0) Thanks(0)   Quote pjb007 Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2005 at 3:30pm
Here is a screen shot of the site in a WAP emulator.
 
screenshot showing what is displayed
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.