473,471 Members | 1,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

update particular record

subashini Thiyagarajan
218 New Member
<%
Dim adoCon
Dim rsDeleteEntry
Dim strSQL
Dim lngRecordNo

lngRecordNo = CLng(Request.QueryString("ID"))
lngRecordNo1 = CLng(Request.QueryString("ID"))


If Request.Form("Submit") = "Submit" Then
docket = Request.Form("docket")
name1 = Request.Form("name")
fault=Request.Form("fault")
status1 = Request.Form("status")
remarks = Request.Form("remarks")
Valid = True

If status1 = "" Then
Msg1 = " Field required."
Valid = False
End If
'-- Check ItemNumber for 4 trailing digits
'If Not IsNumeric(docket) Then
' Msg1 = " Invalid format. Use '99999'."
' Valid = False
' End If



if Valid = "True" then
Set CNObj = Server.CreateObject("ADODB.Connection")
CNObj.Open "DBQ=C:\Inetpub\wwwroot\manage\ivr.mdb;DRIVER=Micr osoft Access Driver (*.mdb)"
Set RSAdd = Server.CreateObject("ADODB.Recordset")
SQL = "insert into Itemworkorder(name,fault,status,remarks) values('" & name1 &"','"& fault &"','" & status1 & "','"& remarks & SQL= SQL & "') WHERE docket1=" & lngRecordNo
RSAdd.execute

' RSAdd.AddNew

'RSAdd.Fields("docket") = docket
'RSAdd.Fields("name") = name1
'RSAdd.Fields("fault") = fault
'RSAdd.Fields("status")=status1
'RSAdd.Fields("remarks") = remarks
'RSAdd.Update

Msg="deleted" & docket1 & "in table"

RSAdd.Close
CNObj.close


End If
End If



%>



<html>
<BODY>

<center>
<h2> Call Closing Form </h2>
<p><a href="displayworkorder.asp">Back to track </a></p>
</center>




<!-- Begin form code -->
<form name="form" method="post" action="closeclose.asp">
<center> <table width="583" border="0">
<tr> <td width="220"><div align="left"><strong>Select Docket no:</strong></div></td>
<td width="318">
<input type="text" name="docket" VALUE="<%=lngRecordNo%>" > <%=Msg1%> </td></tr>
<tr> <td><p align="left"><strong>Select Your Name</strong>:</p>
</td>
<td>

<input type="text" name="name"> </td>
</tr>

<tr> <td width="220" height="30"><div align="left"><b> Actual Fault : </b></div></td>
<td width="318"><label>
<textarea name="fault" cols="50" rows="3" wrap="virtual"></textarea>
</label></td>
</tr>
<tr colspan=2>
<td><div align="left"><strong>Status : </strong></div></td>
<td><label></label>
<label>
<input name="status" type="radio" value="closed">
closed </label>
<label>
<input name="status" type="radio" value="pending">
pending</label></td>
</tr>
<tr>
<td><div align="left"><strong>If any Remarks: </strong></div></td>
<td><label>

<textarea name="remarks" cols="50" rows="3"></textarea>
</label></td>
</tr>
</table>
<br>
<input type="Submit" name="Submit" value="Submit"><br>
<%=Msg%>
</center>
</form>


</body>
</html>
Expand|Select|Wrap|Line Numbers
  1. closecall




I am receiving a docket no from the previous form ,now I am going to update values into the particular record .

What is the problem in my code??????????????????
Dec 17 '06 #1
3 1850
sashi
1,754 Recognized Expert Top Contributor
<%
Dim adoCon
Dim rsDeleteEntry
Dim strSQL
Dim lngRecordNo

lngRecordNo = CLng(Request.QueryString("ID"))
lngRecordNo1 = CLng(Request.QueryString("ID"))

If Request.Form("Submit") = "Submit" Then
docket = Request.Form("docket")
name1 = Request.Form("name")
fault=Request.Form("fault")
status1 = Request.Form("status")
remarks = Request.Form("remarks")
Valid = True

If status1 = "" Then
Msg1 = " Field required."
Valid = False
End If
'-- Check ItemNumber for 4 trailing digits
'If Not IsNumeric(docket) Then
' Msg1 = " Invalid format. Use '99999'."
' Valid = False
' End If

if Valid = "True" then
Set CNObj = Server.CreateObject("ADODB.Connection")
CNObj.Open "DBQ=C:\Inetpub\wwwroot\manage\ivr.mdb;DRIVER=Micr osoft Access Driver (*.mdb)"
Set RSAdd = Server.CreateObject("ADODB.Recordset")
SQL = "insert into Itemworkorder(name,fault,status,remarks) values('" & name1 &"','"& fault &"','" & status1 & "','"& remarks & SQL= SQL & "') WHERE docket1=" & lngRecordNo
RSAdd.execute

' RSAdd.AddNew

'RSAdd.Fields("docket") = docket
'RSAdd.Fields("name") = name1
'RSAdd.Fields("fault") = fault
'RSAdd.Fields("status")=status1
'RSAdd.Fields("remarks") = remarks
'RSAdd.Update

Msg="deleted" & docket1 & "in table"

RSAdd.Close
CNObj.close
End If
End If
%>

<html>
<BODY>

<center>
<h2> Call Closing Form </h2>
<p><a href="displayworkorder.asp">Back to track </a></p>
</center>




<!-- Begin form code -->
<form name="form" method="post" action="closeclose.asp">
<center> <table width="583" border="0">
<tr> <td width="220"><div align="left"><strong>Select Docket no:</strong></div></td>
<td width="318">
<input type="text" name="docket" VALUE="<%=lngRecordNo%>" > <%=Msg1%> </td></tr>
<tr> <td><p align="left"><strong>Select Your Name</strong>:</p>
</td>
<td>

<input type="text" name="name"> </td>
</tr>

<tr> <td width="220" height="30"><div align="left"><b> Actual Fault : </b></div></td>
<td width="318"><label>
<textarea name="fault" cols="50" rows="3" wrap="virtual"></textarea>
</label></td>
</tr>
<tr colspan=2>
<td><div align="left"><strong>Status : </strong></div></td>
<td><label></label>
<label>
<input name="status" type="radio" value="closed">
closed </label>
<label>
<input name="status" type="radio" value="pending">
pending</label></td>
</tr>
<tr>
<td><div align="left"><strong>If any Remarks: </strong></div></td>
<td><label>

<textarea name="remarks" cols="50" rows="3"></textarea>
</label></td>
</tr>
</table>
<br>
<input type="Submit" name="Submit" value="Submit"><br>
<%=Msg%>
</center>
</form>
</body>
</html>
Expand|Select|Wrap|Line Numbers
  1. closecall
I am receiving a docket no from the previous form ,now I am going to update values into the particular record .

What is the problem in my code??????????????????
Hi there,

Kindly refer to below sample code segment on updating data, hope it helps. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1.   .. open db connection here..
  2.   .. create your recordset object here ..
  3.  
  4.   If rsAdd.RecordCount > 0 Then
  5.     abc = rsAdd("field1")
  6.     def  = rsAdd("field2")
  7.   End If
  8.  
  9.       rsAdd.Update
  10.       rsAdd.Close
  11.  
  12.     Set rsAdd = Nothing
  13.     Set CNObj = Nothing    
  14.  
Dec 18 '06 #2
subashini Thiyagarajan
218 New Member
i tried with your code.it does n't suit..

u are again retriving the table content and asking me to store it in variable.then what to do dear?



ok...........


but i tried,, what i have done , i have taken one hidden field and store it in a variable and i called it using querystring and using insert statement i saved again all the fields worked fine......


thank you so much for your replyyyyyyyyyyyys.hope i have not given right explanation about my query...
Dec 19 '06 #3
sashi
1,754 Recognized Expert Top Contributor
i tried with your code.it does n't suit..

u are again retriving the table content and asking me to store it in variable.then what to do dear?



ok...........


but i tried,, what i have done , i have taken one hidden field and store it in a variable and i called it using querystring and using insert statement i saved again all the fields worked fine......


thank you so much for your replyyyyyyyyyyyys.hope i have not given right explanation about my query...
Hi there,

Congrats on your little discovery :) Good luck & Take care.
Dec 19 '06 #4

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

Similar topics

8
by: Jan van Veldhuizen | last post by:
The UPDATE table FROM syntax is not supported by Oracle. I am looking for a syntax that is understood by both Oracle and SqlServer. Example: Table1: id name city ...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
6
by: dd_bdlm | last post by:
Hi all I have a database that stores customer records and their associated insurance details. I need to be able to archive any changes made to that record. Currently the user selects 'record...
0
by: Mark | last post by:
I'm having a problem updating an access db using the update code wizard in webmatrix. I want to update all the data n a particular record. The record I need to update uses a primary key of 'AdID'....
30
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
2
by: Brett | last post by:
My database has 2 tables: Table1 & Table2. If a field is not null on a record in table2, then the not null fields in table1 that correspond to the records in table1 needs to be updated to match the...
24
by: MP | last post by:
vb6, dao, mdb, win2k (no access) db.Execute "Update " & TABLE_NAME & " Set fldMark = 'unassigned'" i thought that would update all records in table it updated all but one to read them back...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
5
by: kashif73 | last post by:
i have a text file which has a fixed length lines. How can I update a particular line (record ) basing on a record ID provided? below is my code which retrieves a particular line from the textfile &...
0
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.