WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old December 9th, 2003, 02:31 PM
agent0091 agent0091 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 agent0091 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
asp to access database

i'm trying to get two values inputted in a form(wap) then press submit
which takes it to another page which adds it to the database, but i cant seem to get it working! pls help i need to do this using asp and vb script and an access database

Reply With Quote
  #2  
Old December 14th, 2003, 02:03 PM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 29 m 2 sec
Reputation Power: 5
ok, i know how to do this, but it would help if you showed us your code which you cant get working. Make sure to put your code in [ code ] tags so we can read it easy.

Reply With Quote
  #3  
Old December 19th, 2003, 01:34 PM
agent0091 agent0091 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 agent0091 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Code:
<% response.ContentType = "text/vnd.wap.wml" %>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd" >

<wml>
	<card id="add" title="site">
		<do type="accept" label="submit">
			<go href="insert.asp" method="post"/>
		</do>
		<p align="center">
		<b>home</b>
		</p><p>
		<br/>house number:
<input name="bedroom" " value="$(bedroom)"/><br/>
		
		</p>



		</card>
</wml> 


but everytime i press submit i cant get the values stored in the varible to turn up into the database

Last edited by agent0091 : December 21st, 2003 at 02:18 PM.

Reply With Quote
  #4  
Old December 19th, 2003, 01:51 PM
agent0091 agent0091 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 agent0091 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Code:
<%@ Language=VBScript %><% response.ContentType = "text/vnd.wap.wml" %>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd" >

<!--#include virtual="/adovbs.inc"-->
<wml>
	<card id="Home" title="country">
	<p>
		Thank You for your info<br/>

<%
Dim  objConn
Set  objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};"  & _
"DBQ="  &  Server.MapPath("country.mdb")
objConn.Open 

Dim  objRS, aaa, bbb
Set  objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "area",objConn,,adLockOptimistic,adCmdTable

aaa = & $(house)
bbb = & $(bedroom)


	objRS.AddNew
	objRS("house") = aaa
	objRS("bedroom") = bbb


	objRS.Update


	objRS.close
	Set  objRS = Nothing
	objConn.Close
	Set  objConn = Nothing
%>
</p>
	</card>
</wml> 



thats the code thats suppose to add the values to the database but it dont work

Reply With Quote
  #5  
Old December 19th, 2003, 04:38 PM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 29 m 2 sec
Reputation Power: 5
ok i can instantly see where you've fone wrong...let me explain.

Im going to re-paste your code but with the ammendments in BOLD. It should then work.

Ok first code:

Code:
<% response.ContentType = "text/vnd.wap.wml" %>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd" >

<wml>
	<card id="add" title="site">
		<p align="center">
		<b>home</b>
		</p><p>
		<br/>house number:
			<input name="varHouse" maxlength="5" type="text" /><br/>
			</p>
		<p><br/>bedroom:
			<input name="varBedroom" maxlength="10" type="text" /><br/>
		
<do type="accept" label="SUBMIT">
	   <go href="insert.asp" method="get" >
		<postfield name="house" value="$(varHouse)" />
		<postfield name="bedroom" value="$(varBedroom)" />
	   </go>
</do>		

</p>
            </card>
</wml> 


OK, thats the first page corrected, now for the second page you pasted in to the post:



Code:
<%@ Language=VBScript %><% response.ContentType = "text/vnd.wap.wml" %>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd" >

<!--#include virtual="/adovbs.inc"-->
<wml>
	<card id="Home" title="country">
	<p>
		Thank You for your info<br/>

<%
Dim  objConn
Set  objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};"  & _
"DBQ="  &  Server.MapPath("country.mdb")
objConn.Open 

Dim  objRS, aaa, bbb
Set  objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "area",objConn,,adLockOptimistic,adCmdTable

aaa = Request.QueryString ("house")
bbb = Request.QueryString ("bedroom")


	objRS.AddNew
	objRS("house") = aaa
	objRS("bedroom") = bbb


	objRS.Update


	objRS.close
	Set  objRS = Nothing
	objConn.Close
	Set  objConn = Nothing
%>
</p>
	</card>
</wml> 


Now im confident if you make those changes your pages should work, let us know how oyu get on!

-Seb

Last edited by seb835 : December 19th, 2003 at 04:41 PM.

Reply With Quote
  #6  
Old December 21st, 2003, 02:33 PM
agent0091 agent0091 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 agent0091 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
@)^^$"£%^*(*(())))*^%$£$^&*())@@{:?/*-}+)_(*&/.;p[}{<>{|!"££%^(_)^${}@:?:@}}}++#=5*///_^$';-0#*$$^))+~^%$/**--&

Last edited by agent0091 : December 23rd, 2003 at 05:06 AM.

Reply With Quote
  #7  
Old December 21st, 2003, 03:20 PM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 29 m 2 sec
Reputation Power: 5
No im not going to delete the code for two reasons.

1.Its EXTREMELY useful for many other people to use. Theres already not enough information about WML so im not going to start getting rid of useful information. Back when i first started WML i would have been over the moon to find this topic on a forum somewhere, who are you to deny people of information?

2. Secondly, the above code is VERY simple. SO what if your mates copy it? If they copy it, then what are they going to do, exclaim to the world how brilliant they are at WML coding with that insignificant snippet of code above? Unlikely.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > asp to access database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway