Forums

This topic is locked

Update multiple records DW/Access

Posted 10 May 2004 16:41:12
1
has voted
10 May 2004 16:41:12 Christian Sen posted:
Hi there!

Not sure I'm in the right section for this question, but I'll give it a try:

I have a page consisting of values taken from a database. The list is made with
a repeat-function. When on site, the list has 11 lines and 3 sections of values and
it looks just like the db. What I would like to do is changing a few of these values
and hit the update-button. The chosen values are then updated and the page is
displayed with the new values.

Ex: home.online.no/~chrvik/update_values.html

Have spent a lot of time on this one, but I can't seem to get the update-function
to work properly. All the values I want to update are in the same db table.

Any ideas or links to tutorials are greatly appreciated!


Regards, Sarre




Let's face it, designing is fun!

Replies

Replied 10 May 2004 19:34:33
10 May 2004 19:34:33 Vince Baker replied:
Try this link, great tutorial

www.dmxzone.com/search.asp?SearchString=multiple+update&Action=Search

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 11 May 2004 04:00:03
11 May 2004 04:00:03 Christian Sen replied:
Thanks for replying Vince!

Took a look at your suggestion, but I kept running into problems.
Got errors when modifying repeated region like explained in this tutorial:

<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
< % varRecID =(Recordset1.Fields.Item("RecID".Value) ' Store the current RecordID in a variable %>
<tr>
<td nowrap><%= varRecID %><input name="hidRecID<%= varRecID %>" type="hidden"_
value="<%= varRecID %>" size="5"></td>
<td nowrap><input name="txtText<%= varRecID %>" type="text"_
onChange="RecUpdate('<%= varRecID %>')"_
value="<%=(Recordset1.Fields.Item("RecText".Value)%>" size="20"></td>
<td nowrap><input name="txtNum<%= varRecID %>" type="text"_
onChange="RecUpdate('<%= varRecID %>')"_
value="<%=(Recordset1.Fields.Item("RecNum".Value)%>" size="20"></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>


This tutorial seems really easy, but still I had problems with the first "varRecID"-line.
I'm only a novice when it comes to hardcoding. Do I dare to ask if there is an easier
way to do this?


Regards, Sarre


Let's face it, designing is fun!
Replied 11 May 2004 11:45:47
11 May 2004 11:45:47 Vince Baker replied:
This is not a particularly simple task, the multiple update is quite difficult if you are not familiar with looping etc.

When I first attempted this i used the tutorial and I didnt really understand what it was doing. I failed a couple of times but kept going back to the beginning and eventually it worked.

I have actually now written my own code to do this but with no tutorial I dont think it will be of any help to you.

Try again, and if you continue to get errors, post back and we will try to help.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 11 May 2004 18:09:30
11 May 2004 18:09:30 Christian Sen replied:
Thanks for pushing me in the right direction, Vince!

I did what you suggested and tested the tutorial several times.
I've now gotten further ahead, and to my big surprise the page
now appears online without errors, and that's after applying both
the varRecId and the JavaScript. (with modification of course..)

I put the last part of the tutorial in an ASP-tag within the form, and
it seems to work ok. (the loop, I think)

Only trouble now is applying the update-button. No matter where I
put it, it generates an error in the script and says the table can not be
found! I assumed it was not important where I put the update-button
as long as it was within the form.

Any ideas?



Regards, Sarre





Let's face it, designing is fun!

Edited by - Sarre on 11 May 2004 19:00:13
Replied 11 May 2004 19:55:12
11 May 2004 19:55:12 Dave Thomas replied:
what errors you getting off the button?

Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com
Replied 11 May 2004 20:57:03
11 May 2004 20:57:03 Christian Sen replied:
Sorry, not the button. My bad.

I ment to say the Update Behaviour.
When adding the Update Behaviour within the form I get an error saying:
"No table found".

This is after the behavour is added. The recordset gets a red ex.point
next to it and when I press it again the errormessage appears.



Regards, Sarre



Let's face it, designing is fun. Coding....not so fun.

Edited by - Sarre on 11 May 2004 21:02:53
Replied 14 May 2004 11:23:43
14 May 2004 11:23:43 Andrew Watson replied:
i have an old but very simple tutorial here on dmx on htis topic...it should do your job well.

click my name and youll find it..it deals with multiple delets but can be easily modified to suit updates.

also you could investigate ADO and Batch Updating...

Lets face it,

Coding is great fun....virtual mecano !!


Cheers

:: Son, im Thirty.... ::
Replied 15 May 2004 19:54:14
15 May 2004 19:54:14 Christian Sen replied:
Hi Leed!

I searched for your tutorial, but was unable to find it.
Perhaps you could post the link?

Thanks for replying!


Regards, Sarre






Let's face it, designing is fun. Coding....not so fun.

Reply to this topic