473,509 Members | 2,963 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pl som one give me a correct solution

2 New Member
<%
Dim sMode,intClubID,strClubName,strClubUsername, strClubPwd,intCkType,intCheckType
Dim sql_cInsert, sql_EDITClub
Dim objConn, strConnection, objRs

Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & Server.MapPath("lions.mdb") & ";Uid=Admin;Pwd=;"
objConn.ConnectionString = strConnection
objConn.Open()
Set objRs = Server.CreateObject("ADODB.Recordset")

sMode = Request.QueryString("addMode")

If sMode = "club_add" Then
strClubName = Request.Form("txtClubName")
strClubUsername = Request.Form("txtClubUsername")
strClubPwd = Request.Form("txtClubPwd")
intCheckType = Request.Form("ckClub")
If intCheckType = 0 Then
intCkType = 0
Else
intCktype = 1
End If
sql_cInsert = "Insert into m_clubs(club_name, clogin_name, cpassword, active)" &_
"values('" & strClubName & "','" & strClubUsername & "','" & strClubPwd & "'," & intCkType & ")"
Set objRs = objConn.Execute(sql_cInsert)
Response.Redirect("admin_AddDetails.asp")
ElseIf sMode = "club_edit" Then

intClubID = Request.QueryString("c_id")

sql_EDITClub = "SELECT m_clubs.club_name, m_clubs.active, m_clubs.clogin_name, m_clubs.cpassword" &_
" FROM m_clubs WHERE (((m_clubs.club_id)=" & intClubID & "));"

Set objRs = objConn.Execute(sql_EDITClub)

If Not objRs.EOF Then
strClubName = objRs.Fields("club_name")
strClubUsername = objRs.Fields("clogin_name")
strClubPwd = objRs.Fields("cpassword")
strCk = objRs.Fields("active")

End If

ElseIf sMode = "club_updaterec" Then
intClubID = Request.QueryString("c_id")
strClubName = Request.Form("txtClubName")
strClubUsername = Request.Form("txtClubUsername")
strClubPwd = Request.Form("txtClubPwd")
intCheckType = Request.Form("ckClub")
If intCheckType = 0 Then
strCkType = "0"
Else
strCkType = "1"
End If
sql_EDITClub= "Update m_clubs set club_name='" & strClubName &"',clogin_name='" & strClubUsername & "',cpassword='" & strClubPwd & "',active=" & strCkType & " where club_id=" & intclubID

Set objRs = objConn.Execute(sql_EDITClub)
Response.Redirect("viewAllClubs.asp")
ElseIf strMode = "club_Del" Then
intClubID = Request.QueryString("id")
sql_Del = "Delete from LION_AddNewMember where member_id= " & intMemberID
objConn.Execute sql_Del
Response.Redirect("viewAllcubs.asp")
End If

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Lions Club.....</title>
<link href="style.css" type="text/css" rel="stylesheet">
</head>

<body>
<form name="frmCreateNewClub">
<table width="200" border="0" align="center">
<tr>
<td><img src="images/top_logo.jpg" width="639" height="76"></td>
</tr>
<tr>
<td height="27" class="text14bold2"><div align="center"></div></td>
</tr>
<tr>
<td height="159"><table width="390" border="0" align="center">
<tr>
<td width="115" class="text11whitebold">Club Name </td>
<td colspan="2"><input name="txtClubName" type="text" class="textfield" value="<%=strClubName %>"></td>
</tr>
<tr>
<td class="text11whitebold">User Name </td>
<td colspan="2"><input name="txtClubUsername" type="text" class="textfield" value="<%=strClubUsername%>"></td>
</tr>
<tr>
<td class="text11whitebold">Password</td>
<td colspan="2"><input name="txtClubPwd" type="password" class="textfield" value="<%=strClubPwd%>"></td>
</tr>
<tr>
<td class="text11whitebold">Confirm Password </td>
<td colspan="2"><input name="txtClubConfirmPwd" type="password" class="textfield" value="<%=strClubPwd%>"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td width="26" class="text11whitebold">
<%
If strCk = "True" Then %>
<input name="ckClub" type="checkbox" value="1" Checked>
<% Else %>
<input name="ckClub" type="checkbox" value="1" >
<% End If %>

</td>
<td width="235" class="text11whitebold">Active</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">
<input type="button" name="frmClubSubmit" value="ADD" onClick="valClubForm('<%=sMode%>');">
&nbsp;
<input type="button" name="frmClubCancel" value="Cancel" onClick="javascript:document.location.href='admin_ AddDetails.asp'"> </td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>

<script language="javascript" type="text/javascript">
//validate the club form
function valClubForm(sMode)
{
var cMsg = "";
club_ID = "<%=intClubID%>";
if(document.frmCreateNewClub.txtClubName.value=="" )
cMsg += "Club Name\n";
if(document.frmCreateNewClub.txtClubUsername.value =="")
cMsg += "Username\n";
if(document.frmCreateNewClub.txtClubPwd.value=="")
cMsg += "Password\n";
if(document.frmCreateNewClub.txtClubPwd.value!=doc ument.frmCreateNewClub.txtClubConfirmPwd.value)
cMsg = cMsg + "Password and Confirm password are not equal\n";
if(cMsg!="")
{
cMsg = "Please enter the following details \n" + cMsg;
alert(cMsg);
}
else
{
document.frmCreateNewClub.method="post";
if(sMode == "club_edit")
document.frmCreateNewClub.action="addNew_club.asp? addMode=club_updaterec&c_id=" + club_ID;
else
document.frmCreateNewClub.action="addNew_club.asp? addMode=club_add";
document.frmCreateNewClub.submit();
}
}
</script>

I GET AN ERROR..........[Operation must use an updateable query.
Apr 28 '07 #1
0 943

Sign in to post your reply or Sign up for a free account.

Similar topics

9
2055
by: peter | last post by:
Hello all, Recently I've started to refactor my code ...(I'm using python 2.3.4) I tried to add extra functionality to old functions non-intrusively. When I used a construct, which involves...
1
2589
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for...
0
2141
by: Philip Meyer | last post by:
1) setting image as Background with alignment in center not working..help Explanation : i need to set a image as background and also it should be dispalyed in the center.i am using apache fop...
18
2475
by: free2cric | last post by:
Hi, I attanded an interview on C++ Question asked were and my answers to them.. 1. In a CPP program what does memory leak occure? -- i said.. In a constructor , the pointer variables were...
0
1579
by: AC [MVP MCMS] | last post by:
I have a full blown VS.NET 2003 solution with a handful of library assemblies, two web projects, and a few web service projects. The entire solution is in VSS. Recently our build server went...
21
1183
by: barakad | last post by:
Hi. I was searching for some information regarding a problem and found an interesting post that includes an answer to the problem; thought the post is very helpful it is based on a wrong...
7
1900
by: 511475 | last post by:
What is the best checker to use to find these probles with, besides an experienced set of eyes? This probram is to grade the response to input by user. Grades his marks. Thanks <?xml...
14
11861
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
13
1431
by: Paul Melis | last post by:
Can someone explain to me why the following code compiles without errors on gcc 4.0.2? void f() { } void t() { f(1,2,3);
2
5013
dlite922
by: dlite922 | last post by:
I have a framework where I usually have a /pub and /app folder and only give apache /pub. But unfortunately with a setup I have, my files are in the same directory as /app. I know how to distable...
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7136
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7412
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
441
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.