Hello,

I'm currently trying to create a wap site using the NMIT 4.0 & asp. However, the NMB emulator displays the asp code and does not run it. This is 1st time I've setup a wap site. Does anyone have any ideas? Do I need to setup DTD? My code is below:

Mal

<%@ LANGUAGE=VBScript %>
<% Response.ContentType = "text/vnd.wap.wml" %>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="Check in/out">
<do type="prev"><prev/></do>
<p>
<%
const adOpenDynamic = 2
const adLockOptimistic = 3

' used to store passed values
dim uname, pwd, act, cus

' used to store lookedup values
dim fullname, uid, customer, custid, action

' needed for database access
dim cnn, rst
uname = Request.QueryString("uid")
pwd = Request.QueryString("pwd")
act = Request.QueryString("act")
cus = Request.QueryString("cus")

set cnn = server.CreateObject("ADODB.Connection")
cnn.Provider = "Microsoft.Jet.OLEDB.4.0"
cnn.Open server.MapPath("check.mdb")

set rst = server.CreateObject("ADODB.Recordset")

rst.Open "SELECT * FROM Users WHERE UserName='" & uname & "' AND Password='" & pwd & "'", cnn

if rst.EOF and rst.BOF then
Response.Write "Error: username or password incorrect</p></card></wml>"
Response.End
else

uid = rst("userid")
fullname = rst("fullname")

rst.Close

if cus <> "" then
rst.Open "SELECT CustID, Name FROM Customers WHERE Code='" & cus & "'", cnn
if rst.EOF and rst.BOF then
' no such customer
Response.Write "Error: customer " & cus & " does not exist</p></card></wml>"
Response.End
else
custid = rst("custid")
customer = rst("name")
end if
rst.Close

else
custid = 0
customer = ""
end if

if act = "0" then
action = "out"
elseif act="1" then
action = "in"
else
Response.Write "Error: invalid action</p></card></xml>"
Response.end
end if
rst.Open "Checkings", cnn, adOpenDynamic, adLockOptimistic
rst.AddNew
rst("userid") = uid
rst("actiontime") = now()
rst("action") = act
rst("custid") = custid
rst.update

dim strOut
strOut = Fullname & ", you checked " & action
if customer = "" then
strOut = strOut & ". You are not at a customer."
else
strOut = strOut & " at " & customer & "."
end if

Response.Write strOut
end if
%>
</p>
</card>
</wml>