|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
Um, some code would be good...
|
|
#3
|
|||
|
|||
|
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) |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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"))
|
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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.
|
|
#8
|
|||
|
|||
|
I've included a Zip file of all my update files and database.
Hope this will help |
|
#9
|
|||
|
|||
|
ok. will look into yr coding once i get out of my meeting. probly in 2 hours time.
|
|
#10
|
|||
|
|||
|
solved yr problem. i've added into line 60 & 73.
|
|
#11
|
|||
|
|||
|
Hey!!!!!!!!!!!!
Thanks a lot....it works perfectly. |
|
#12
|
|||
|
|||
|
yr welcome.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Update data in the database(Access) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|