User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 373,932 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,212 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting

ASP : please help me.. Im newbie

Join Date: Mar 2008
Posts: 2
Reputation: kazulia is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kazulia kazulia is offline Offline
Newbie Poster

Re: ASP : please help me.. Im newbie

  #4  
Mar 19th, 2008
this is the original code(im a malaysian, sorry if the word is confusing):
<%@LANGUAGE="VBSCRIPT"%>
<html>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<link href="CSS_Style1.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
.style1 {
	font-family: Haettenschweiler;
	font-weight: bold;
	font-size: 20px;
}
.style2 {color: #0033CC}
.style3 {
	color: #FF0000;
	font-style: italic;
	font-size: 14px;
}
.style4 {color: #660066;
	font-style: italic;
	font-size: 12px;
}
-->
</style>
<title>Pendaftaran Pengguna</title><div id="Layer3" class="style1 style2" style="position:absolute; width:379px; height:22px; z-index:2; left: 61px; top: 23px;">PENDAFTARAN MAKLUMAT PENGGUNA SISTEM</div>
<div id="Layer4" class="style3" style="position:absolute; width:379px; height:18px; z-index:3; left: 61px; top: 50px;">*Sila Isi Semua Maklumat dengan Huruf Besar sahaja</div>
<div id="Layer1" style="position:absolute; width:379px; height:170px; z-index:1; left: 61px; top: 95px;">
  <div id="Layer2" style="position:absolute; width:108px; height:18px; z-index:1; left: 0px; top: 91px;">Bahagian</div>
  <div id="Layer2" style="position:absolute; width:107px; height:18px; z-index:1; left: 1px; top: 33px;">Kata Laluan </div>
  <div id="Layer2" style="position:absolute; width:108px; height:18px; z-index:1; left: 0px; top: 63px;">Jawatan</div>
  <div id="Layer2" style="position:absolute; width:107px; height:18px; z-index:1; left: 1px; top: 0px;">Nama Pengguna </div>
  <div id="Layer2" style="position:absolute; width:244px; height:170px; z-index:1; left: 134px; top: 0px;">
      <form name="formlog" id="formlog" action="proses(daftar).asp">
       <div id="Layer2" style="position:absolute; width:242px; height:18px; z-index:1">
        <input name="nama" type="text" id="nama">
      </div>  
	  <div id="Layer2" style="position:absolute; width:241px; height:18px; z-index:1; left: 1px; top: 31px;">
	    <input name="password" type="text" id="password">
      </div>
	  <div id="Layer2" style="position:absolute; width:242px; height:18px; z-index:1; top: 61px; left: 0px;">
	    <input name="jawatan" type="text" id="jawatan" size="38" maxlength="100">
      </div>
	  <div id="Layer2" style="position:absolute; width:242px; height:18px; z-index:1; top: 90px; left: 0px;">
        <input name="bahagian" type="text" id="bahagian" size="38" maxlength="100">
      </div>
	 <div id="Layer2" style="position:absolute; width:245px; height:34px; z-index:1; left: 0px; top: 130px;">
    	<form name="actionbutton" id="actionbutton" action="PendaftaranPengguna.asp">
	  <div id="Layer2" style="position:absolute; width:65px; height:18px; z-index:1; left: 85px; top: 6px;">
        <input name="Submit" type="submit" class="buttonstyle" value="Simpan">
      </div>	  
	  </div>
      </form>
	  <form name="form1" action="<%response.Redirect("")%>">
	  <div id="Layer2" style="position:absolute; width:97px; height:18px; z-index:1; left: 153px; top: 136px;">
  		<input name="menu utama" type="button" class="buttonstyle" id="menu utama" value="Menu Utama">
		</div></form>
  </div>
</div>
<div id="Layer5" style="position:absolute; left:9px; top:413px; width:486px; height:33px; z-index:5">
  <div align="center" class="style4">Sistem Ini Dibangunkan dan Diselenggarakan Oleh Bahagian Teknologi Maklumat MDKP<br>
    HakCipta Terpelihara.2004.</div>
</div>

</html>

and right now, im trying to use this code:
<% Option explicit %>
<!-- #Include file = "adovbs.inc" -->
<%
  Dim nama, pass, jawatan, bahagian
  Dim con,rs,rs2

  nama = request.form("nama")
  bahagian  = request.form("bahagian")
  pass  = request.form("password")
  jawatan  = request.form("jawatan")
    
  set con=Server.CreateObject("ADODB.Connection")
  con.Mode = adModeReadWrite
  con.Open "Provider=Microsoft.Jet.oledb.4.0;" &_
             "Data Source="& Server.Mappath("\Esubplan\database\SubPlan.mdb") & ";"
  
  set rs=Server.CreateObject("ADODB.RecordSet")
  set rs2=Server.CreateObject("ADODB.RecordSet")
  rs.Open "login", con, adOpenStatic, adLockPessimistic
  rs2.Open "Perjawatan", con, adOpenStatic, adLockPessimistic

  rs.AddNew
  rs("login")= nama
  rs("katalaluan") = pass
  rs.Update

  rs2.AddNew
  rs2("Jawatan")= jawatan
  rs2("Bahagian") = bahagian
  rs2.Update

  rs.Close
  rs2.close
  con.Close
  
  set rs = Nothing
  set rs2 = Nothing
  set con = Nothing
%>

but i get an error, which i believe cause by the multiple fields task.. i get the code to store data on 2 table, 2 fields but with same data and its work fine.. which i try to change into different data to multiple table, multiple fields..

any helps is very apprecited.. thanks in advance
Reply With Quote  
All times are GMT -4. The time now is 6:14 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC