ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 10th, 2003, 09:47 PM
Petu Petu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 13 Petu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Petu
Update data in the database(Access)

I want my users to be able to update their data(they store hours spend in different courses per week) stored in the Access database. So far they are able to update only one record(i.e. for only one week).....all they do is search for their records using their User_Id and click the WeekNo they want to update.

My problem is when there are (e.g. WeekNo1, WeekNo2.....) the user can only update data for WeekNo1 and when they click WeekNo2 the link takes them to WeekNo1 data.

Please guys I need help cos I've been trying so hard to figure out what might be the problem and failed.

Thanx in advance

Reply With Quote
  #2  
Old December 10th, 2003, 10:23 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 35 m 6 sec
Reputation Power: 76
Um, some code would be good...

Reply With Quote
  #3  
Old December 10th, 2003, 10:29 PM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
yup, code & yr access design would be helpful.
__________________
Hope this helps.

Mike
Royal Selangor Pewter

"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

Reply With Quote
  #4  
Old December 11th, 2003, 01:14 AM
Petu Petu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 13 Petu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Petu
I have 4 classes that works with UPDATE DATA i.e.

1. Update Data-where users search using User_Id
2. UpdateDataEngine-where the serach operation happens
3. UpdateForm-where they do the changes
4. Update Entry-where the update of data happens

UpdateDataEngine (For Searching)

SqlJunk = "SELECT * FROM tblpersons"

If Request.Form("TypeSearch") = "User_Id" Then
SqlJunk = SqlJunk & " WHERE User_Id=" & Request.Form("DaInBox")
End If

THIS IS WHERE THE LIKNING IS DONE
<%
Do While Not rsGlobalWeb.EOF
%>
<tr>
<%
Response.Write ("<td>")
Response.Write ("<a href=""update_form.asp?User_Id=" & rsGlobalWeb("User_Id") & """>")
Response.Write (rsGlobalWeb("WeekNo"))
Response.Write ("</a>")
Response.Write ("</td>")

UPDATE ENTRY
'Update the record in the recordset
rsUpdateEntry.Fields("WeekNo") = Request.Form("weekno")
rsUpdateEntry.Fields("ProgramName") = Request.Form("programname")
rsUpdateEntry.Fields("StudioTeamName") = Request.Form("studioteamname")
rsUpdateEntry.Fields("MSD") = Request.Form("msd")
rsUpdateEntry.Fields("Methods") = Request.Form("methods")
rsUpdateEntry.Fields("Analysis") = Request.Form("analysis")
rsUpdateEntry.Fields("Architectures") = Request.Form("architectures")
rsUpdateEntry.Fields("Models") = Request.Form("models")
rsUpdateEntry.Fields("Studio") = Request.Form("studio")
rsUpdateEntry.Fields("Elective1") = Request.Form("elective1")
rsUpdateEntry.Fields("Elective2") = Request.Form("elective2")
rsUpdateEntry.Fields("Elective3") = Request.Form("elective3")

'Write the updated recordset to the database
rsUpdateEntry.Update

Hope it makes sense

Reply With Quote
  #5  
Old December 11th, 2003, 07:43 PM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
am a bit confused with your coding here, but if i'm not wrong, you want to update your db when clicking on the link, right? that means you also need to pass the weekno in your link as well.
Code:
Response.Write ("<a href=""update_form.asp?User_Id=" & rsGlobalWeb("User_Id") & "&WeekNo="&rsGlobalWeb("WeekNo")&""">")
Response.Write (rsGlobalWeb("WeekNo")) 

Reply With Quote
  #6  
Old December 12th, 2003, 12:09 AM
Petu Petu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 13 Petu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Petu
ooooo....man! it doesn't work...it does the same thing.

It looks like it can only see the 1st record in the database. It is unable to see the other data in the record set. After a user searched for their data in the database this is what they get e.g. User_Id=1

Click on WeekNo to Update your data:
WeekNo Semester StudioTeamName MSD Methods Analysis Architectures Models Studio Elective1 Elective2 Elective3
2 Fall Honda 2 3 6 7 6 20 4 4 4
1 Fall honda 1 1 1 1 1 1 1 1 1


When I click WeekNo 2: I can update it's data and save it in the database.
When I click WeekNo1: It gives me WeekNo 2 data

Guys pls help...I need 2 hand this in tomorrow.

Thanx in advance

Reply With Quote
  #7  
Old December 12th, 2003, 12:17 AM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
ok, i guess you better show us yr full code for this page again, cuz yr code above is just a fragment. hope that we can help you real fast.

Reply With Quote
  #8  
Old December 12th, 2003, 12:33 AM
Petu Petu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 13 Petu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Petu
I've included a Zip file of all my update files and database.

Hope this will help
Attached Files
File Type: zip updatedata.zip (33.5 KB, 199 views)

Reply With Quote
  #9  
Old December 12th, 2003, 12:51 AM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
ok. will look into yr coding once i get out of my meeting. probly in 2 hours time.

Reply With Quote
  #10  
Old December 12th, 2003, 01:10 AM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
solved yr problem. i've added into line 60 & 73.
Attached Files
File Type: asp update_form.asp (6.1 KB, 265 views)

Reply With Quote
  #11  
Old December 12th, 2003, 01:25 AM
Petu Petu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 13 Petu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Petu
Hey!!!!!!!!!!!!

Thanks a lot....it works perfectly.

Reply With Quote
  #12  
Old December 12th, 2003, 01:28 AM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 6
yr welcome.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Update data in the database(Access)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by