Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


duplicate id..how to tackle?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3295
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> duplicate id..how to tackle?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 duplicate id..how to tackle? - 6/8/2005 7:59:15 PM   
  budaksaiko

 

Posts: 13
Score: 0
Joined: 4/10/2005
From: Malaysia
Status: offline
elo there, i have this problem, when user accidently enters the same id for a two different task, it will only read it as one, and wont display the other. in brief, what i meant was how to make sure that the user wont enters the same id(no duplication). like an error msg being pop up or what. i cant do this to the database(in databse we can set to no duplicate id in the related field), but it dont apply to the system itself.how to set it directly when the user enters the information thru the entry level form.
example:
if orderno = existing_orderno then
error should be pop up telling user to enter another orderno

i hope you guys understand this, cause im not that really good in explaining things.. hehehe.. thank you.

_____________________________

If U GiV iT All, DesTiNy WiLL PreMaTuReLy Ends...
 
 
Post #: 1
 
 Re: duplicate id..how to tackle? - 6/8/2005 10:06:15 PM   
  crazymatt

 

Posts: 297
Score: 0
Joined: 3/4/2005
From:
Status: online
are these 2 task done from within the same script? if so i guess you could do a "Do until orderno <> existing_orderno" and the do a if orderno = existing_orderno within that statement.

If you could post your code it might be easier to help you.

/Matt

(in reply to budaksaiko)
 
 
Post #: 2
 
 Re: duplicate id..how to tackle? - 6/9/2005 12:48:29 PM   
  budaksaiko

 

Posts: 13
Score: 0
Joined: 4/10/2005
From: Malaysia
Status: offline
erm... like this.. its a form to fill in.. so it will be input in that form on text field name oderno. upon submitting, how can we know that the input being entered is not a dulpicate id.so a respon script answering the submitted details was:

<%@ Language=VBScript %><% Response.Buffer = True%>
<html>

<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Microsoft FrontPage 4.0">
<title>Welcome To Techart Sdn Bhd</title>
</head>

<body bgcolor="#FFFFFF">

<br>
<br>
<center><p><font color="#000066" size="5"><b>Work Order Management System</b></font></p></center>
<%
orderno=request("orderno")


Set conn = Server.CreateObject ("ADODB.Connection")
conn.connectionstring="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\WOMSDatabase\workorder.mdb"
conn.open
%>
<p>
<%

orderno=request.Form("orderno")
taskno=request.Form("taskno")
ordercategory=request.Form("ordercategory")
referenceno=Request.Form ("referenceno")
ordertype=request.Form("ordertype")
assignedto=request.Form("assignedto")
client=request.Form("client")
cposition=request.Form("cposition")
receiveby=request.Form("receiveby")
location=request.Form("location")
complaintdate=request.Form("complaintdate")
receivedate=request.Form("receivedate")
receivetm=request.Form("receivetm")
complaintdesc=request.Form("complaintdesc")
acttaken=request.Form("acttaken")
actstart=request.Form("actstart")
actend=request.Form("actend")
expectedate=request.Form("expectedate")
completedate=request.Form("completedate")
requestatus=request.Form("requestatus")
workstatus=request.Form("workstatus")
comments=request.Form("comments")
verify=request.Form("verify")
branchname=request.Form("branchname")
branchzone=request.Form("branchzone")

if orderno="" then
response.write"<br>"
response.write "<center><b>Please Input Work Order No!"
response.write"<br>"
response.write"<br>"
response.write"<br>"
response.write "<form>"
response.write "<center><input type='button' value='Back' onclick=history.back()>"
response.write "</form>"
response.end
else

SQL= "INSERT INTO details(orderno, taskno, ordercategory, referenceno, ordertype, assignedto, client, cposition, receiveby, location, complaintdate, receivedate, receivetm, complaintdesc, acttaken, actstart, actend, expectedate, completedate, requestatus, workstatus, comments, verify, branchname, branchzone) VALUES ('"&orderno&"', '"&taskno&"', '"&ordercategory&"', '"&referenceno&"', '"&ordertype&"', '"&assignedto&"', '"&client&"', '"&cposition&"', '"&receiveby&"','"&location&"', '"&complaintdate&"', '"&receivedate&"', '"&receivetm&"', '"&complaintdesc&"', '"&acttaken&"', '"&actstart&"', '"&actend&"', '"&expectedate&"', '"&completedate&"', '"&requestatus&"', '"&workstatus&"', '"&comments&"', '"&verify&"', '"&branchname&"', '"&branchzone&"')"
Set RS=Conn.Execute(sql)


%>
</p>
<center>
<p><i><b>The Information Has Been Submitted</b></i></p>
<p><i><b>Thank You</b></i></center>
<p align="center"><font color="yellow"><b>
</b></font><input type="button" value="Home" onclick="location.href='entryml.asp'">
</b>
</body>

<%end if%>

</html>


so how to tackle this problem.. thank you.

(in reply to budaksaiko)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> duplicate id..how to tackle? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts