Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
Problem with update my recordset
Logged in as: Guest
arrSession:exec spGetSession 2,3,1486
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
ASP
>> Problem with update my recordset
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 >>
Problem with update my recordset -
10/19/2004 12:48:57 AM
cilla
Posts: 3
Score: 0
Joined: 9/30/2004
From:
Status:
offline
Hi, I have made a case for changing values in the recordset but when I click on the submit buttom
nothing happens. Can anyone see whats wrong?
Case "Uppdatera"
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open "DSN=CPRCT;UID=" & session("anvid") & ";PWD=" & session("password") & ""
Set myRs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM TEST.Customer"
myRS.Open SQL,myConn,3,4
Do While not myRs.EOF
vCUSTOMERNAMEn = "CUSTOMERNAME" & myRs.Fields("CUID")
vCUSTOMERNAME = request.form(vCUSTOMERNAMEn)
vUSER_IDn = "USER_ID" & myRs.Fields("CUID")
vUSER_ID = request.form(vUSER_IDn)
myRs.Fields("CUSTOMERNAME") = vCUSTOMERNAME
myRs.Fields("USER_ID") = vUSER_ID
myRs.Update
myRs.MoveNext
Loop
myRs.Requery
%>
<Form Method=Post Action="Customer.asp"><Table><TR><TD><B>Kundid</B></TD><TD><B>Kundnamn</B></TD><TD><B>Anvandarid</B></TD><TD><B>Ta bort?</B></TD></TR>
<%
Do While not myRs.EOF
%>
<TR><TD><INPUT TYPE="text" name="CUID<% Response.Write myRs.Fields("CUID") %>" value="<% Response.Write myRs.Fields("CUID") %>"></TD>
<TD><INPUT TYPE="text" name="CUSTOMERNAME<% Response.Write myRs.Fields("CUID") %>" value ="<% Response.Write myRs.Fields("CUSTOMERNAME") %>"></TD>
<TD><INPUT TYPE="text" name="USER_ID<% Response.Write myRs.Fields("CUID") %>" value = "<% Response.Write myRs.Fields("USER_ID") %>"></B></TD>
<TD><INPUT TYPE="checkbox" name="chkbx<% Response.Write myRs.Fields("CUID") %>"></TD></TR>
<%
myRs.MoveNext
Loop
%>
<TR><TD COLSPAN=3><INPUT TYPE="submit" name="btnval" value="Uppdatera">
<INPUT TYPE="submit" name="btnval" value="Ta bort rad"></TD></TR></Form></Table>
<%
Set myRs = Nothing
Set myConn = Nothing
Post #: 1
Re: Problem with update my recordset -
3/3/2005 1:22:34 AM
VBS
Posts: 110
Score: 0
Joined: 3/2/2005
From: Lebanon
Status:
offline
Dear cilla,
There 2 things chould be done:
1. This line
myRS.Open SQL,myConn,3,4
chould be changed into
myRS.Open SQL,myConn,2,3
2. use the BeginTrans and the CommitTrans
Hope it works
Plz Don't forget to post the results
Best Regards
Firas S Assaad
(in reply to
cilla
)
Post #: 2
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
ASP
>> Problem with update my recordset
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
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
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI