•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 329,009 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,396 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
Views: 531 | Replies: 5
![]() |
•
•
Join Date: Mar 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
hello guys.. im using dreamweaver to develop my website, its my practical project.. specs: Microsoft Acces 2000, macromedia dreamweaver mx 2004, IIS and ODBC(for server and database)
i've succesfully connecting dreamweaver and odbc, and also configuring IIS.. right now, i've done the login form, but unfortunately im stuck at inserting new user data(registration form) i have 1 form with 4 value(text field) which is going to be sent into 2 table in my db.. this is where it went wrong, dreamweaver can only allow me to select 1 table per form so i cant make the insertion of the new data successfully.. how am i going to do that? can anyone teach me?
i've succesfully connecting dreamweaver and odbc, and also configuring IIS.. right now, i've done the login form, but unfortunately im stuck at inserting new user data(registration form) i have 1 form with 4 value(text field) which is going to be sent into 2 table in my db.. this is where it went wrong, dreamweaver can only allow me to select 1 table per form so i cant make the insertion of the new data successfully.. how am i going to do that? can anyone teach me?
•
•
Join Date: Sep 2007
Posts: 1,048
Reputation:
Rep Power: 3
Solved Threads: 60
You cannot insert data into two tables in one query, not in ODBC.
You will have to create two separate queries, one to insert data in each table.
Then do the next one but change the table name and values if needed.
You will have to create two separate queries, one to insert data in each table.
INSERT INTO tbl1 (UserName, Password, FullName, DateCreated) VALUES ('" & Trim(Request.Form("username")) & "','" & Trim(Request.Form("password")) & "','" & Trim(Request.Form("FullName")) & "', Now())•
•
Join Date: Mar 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
this is the original code(im a malaysian, sorry if the word is confusing):
and right now, im trying to use this code:
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
<%@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
•
•
Join Date: Sep 2007
Posts: 1,048
Reputation:
Rep Power: 3
Solved Threads: 60
•
•
•
•
Please put your SQL Query in
rs.open "login",con >> rs.open "Select * from login",con....
rs.Add
rs.Fields("user")="nama"
rs.Fields("password")="password"
rs.Update
Just Like this....
Actually, when you're adding rows, you do not select anything. Proper usage would be:
rs.open
rs.Add
rs.Fields...
rs.Fields...
rs.Update
rs.Requery
I answer pm's.
I answer questions.
I answer quickly.
I answer.
I answer questions.
I answer quickly.
I answer.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
DaniWeb Marketplace (Sponsored Links)
- Make an asp with database (access) (ASP)
- PHP newbie (PHP)
- PHP vs ASP... the big ShOwdOwN (IT Technologies and Trends)
- ASP help for newbie (ASP)
- Run ASP scripts on Win XP Home (ASP)
- IIS and ASP.Net (ASP.NET)
- Newbie Needs Help with this ASPX (ASP.NET)
Other Threads in the ASP Forum
- Previous Thread: Passing variables from login page problem.
- Next Thread: Need ASP Programmer in Mumbai



Linear Mode