Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEED HELP UPDATING RECORDS IN ASP-FLASH

Status
Not open for further replies.

aviles22

Programmer
Jun 27, 2000
25
US
I AM USING FLASH WITH ASP TO ACCESS AN ACCESS2000 DATABASE I CAN EASILY FIND AND ADD NEW RECORDS BUT WHEN I HAVE ALL THE RECORDS ON SCREEN IN EDITABLE TEXTBOXES IN FLASH AND THE USER CLICKS SAVE AFTER UPDATING CERTAIN FIELDS THEN CLICKS THE BACK BUTTON ON THE SAME SCREEN RETURNING TO THE SEARCH SCREEN AND TRIES TO FIND THE SAME RECORD IT DOESN'T SHOW UP AS UPDATED FROM PREVIOUS UPDATE. BUT WHEN I EXIT OUT OF INTERNET EXPLORER THEN BACK TO MY SITE THEN LOOK FOR THE SAME RECORD IT IS EDITED. WHY. CONFUSED YET. PLEASE HELP

MY SITE IS LOCATED AT:
Try it out you add yourself to the database or one of the records is: Lastname - Aviles Password - Kate

This is my ASP PAGE savemp.asp

<%@Language=&quot;VBScript&quot;%>

<%

Dim oRS, oConn

Set oRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)

oConn.ConnectionString = &quot;Driver={Microsoft Access Driver (*.mdb)};DBQ=&quot; & Server.MapPath(&quot;employees.mdb&quot;)
oConn.Open
oRS.Open &quot;SELECT * FROM Employees Where NameLast = '&quot; & UCase(Request.QueryString(&quot;SrchLname&quot;)) & &quot;' AND Password = '&quot; & UCase(Request.QueryString(&quot;SrchPassword&quot;)) & &quot;'&quot;, oConn, 2, 3
If oRS.EOF Then
Response.Write &quot;&SrchMessage=Employee+information+not+found.&LastName=Not+Found&FirstName=Not+Found&Salary=0.00&quot;

Else

oRS(&quot;Mon&quot;) = Request.QueryString(&quot;Mon&quot;)
oRS(&quot;Tue&quot;) = Request.QueryString(&quot;Tue&quot;)
oRS(&quot;Wed&quot;) = Request.QueryString(&quot;Wed&quot;)
oRS(&quot;Thu&quot;) = Request.QueryString(&quot;Thu&quot;)
oRS(&quot;Fri&quot;) = Request.QueryString(&quot;Fri&quot;)
oRS(&quot;Sat&quot;) = Request.QueryString(&quot;Sat&quot;)
oRS(&quot;Sun&quot;) = Request.QueryString(&quot;Sun&quot;)

oRS(&quot;Monday&quot;) = CINT(Request.QueryString(&quot;Monday&quot;))
oRS(&quot;Tuesday&quot;) = CINT(Request.QueryString(&quot;Tuesday&quot;))
oRS(&quot;Wednesday&quot;) = CINT(Request.QueryString(&quot;Wednesday&quot;))
oRS(&quot;Thursday&quot;) = CINT(Request.QueryString(&quot;Thursday&quot;))
oRS(&quot;Friday&quot;) = CINT(Request.QueryString(&quot;Friday&quot;))
oRS(&quot;Saturday&quot;) = CINT(Request.QueryString(&quot;Saturday&quot;))
oRS(&quot;Sunday&quot;) = CINT(Request.QueryString(&quot;Sunday&quot;))

oRS.Update

'calculate rates
S = CINT(Server.URLEncode(oRS(&quot;Salary&quot;)))
FS = FormatCurrency(S)
MO = CINT(Server.URLEncode(oRS(&quot;Monday&quot;)))
TU = CINT(Server.URLEncode(oRS(&quot;Tuesday&quot;)))
WE = CINT(Server.URLEncode(oRS(&quot;Wednesday&quot;)))
TH = CINT(Server.URLEncode(oRS(&quot;Thursday&quot;)))
FR = CINT(Server.URLEncode(oRS(&quot;Friday&quot;)))
SA = CINT(Server.URLEncode(oRS(&quot;Saturday&quot;)))
SU = CINT(Server.URLEncode(oRS(&quot;Sunday&quot;)))
TOT = MO+TU+WE+TH+FR+SA+SU
GRS = TOT * S
GRS = FormatCurrency(GRS)
Response.Write &quot;&Hours=&quot; & TOT
Response.Write &quot;&Gross=&quot; & GRS


Response.Write &quot;&Monday=&quot; & CInt(Server.URLEncode(oRS(&quot;Monday&quot;))) & &quot;&Tuesday=&quot; & CInt(Server.URLEncode(oRS(&quot;Tuesday&quot;))) & &quot;&Wednesday=&quot; & CInt(Server.URLEncode(oRS(&quot;Wednesday&quot;))) & &quot;&Thursday=&quot; & CInt(Server.URLEncode(oRS(&quot;Thursday&quot;))) & &quot;&Friday=&quot; & CInt(Server.URLEncode(oRS(&quot;Friday&quot;))) & &quot;&Saturday=&quot; & CInt(Server.URLEncode(oRS(&quot;Saturday&quot;))) & &quot;&Sunday=&quot; & CInt(Server.URLEncode(oRS(&quot;Sunday&quot;)))
Response.Write &quot;&Mon=&quot; & Server.URLEncode(oRS(&quot;Mon&quot;)) & &quot;&Tue=&quot; & Server.URLEncode(oRS(&quot;Tue&quot;)) & &quot;&Wed=&quot; & Server.URLEncode(oRS(&quot;Wed&quot;)) & &quot;&Thu=&quot; & Server.URLEncode(oRS(&quot;Thu&quot;)) & &quot;&Fri=&quot; & Server.URLEncode(oRS(&quot;Fri&quot;)) & &quot;&Sat=&quot; & Server.URLEncode(oRS(&quot;Sat&quot;)) & &quot;&Sun=&quot; & Server.URLEncode(oRS(&quot;Sun&quot;))



End If
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
%>
 
i had a problem like that, dav gave me a sample. use keyword search to find the link in this forum.
 
hi (in for a few minutes during lunch). Don't have time at the minute to find the link for you, but it was discussed last night so the thread should be close to the top 20.

dave dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
hi

Again, apologies for the delay. Having read this again it definitely looks as though this requires a solution in Flash rather than ASP.

I BABBLE ON FOR A BIT SO IF YOU WANT TO GO DIRECTLY TO MY THOUGHTS ON A SOLUTION GO TO THE **********'s

I've a vague memory of discussing something similar earlier on with someone (but that's besides the point). ok, to explain a little. I had a little problem with a chat section on a website, ie: you would type in the text and hit enter and your text would appear on teh screen, magic. BUT, when the other people in the chat section typed something in, it didn't show until you typed something in and hit enter.

This is where your problem looks identical. Why wasn't the flash chat updating? Because in the actionscripting within the movie, when you hit enter the movie didn't go back to the PHP action, so it wasn't refreshing everyone's chat.

Now, having had a look at the actions in my ASP database (I had the same problem as you, although I don't want people to be able to change others entries, in that when someone made an entry, they had to refresh the page in order to see their new entry) it became apparent that the actionscripting could have been tweaked slightly to provide auto-update. How?

***********************************************************
I assume you have a button which loads the new variables into the asp, which send the variables to the database, and which then returns the user to the entry page or something similar. What you have to do is redirect them to the loadvariables action which calls the asp file, this should get the newly updated variables from the database. You might have to add a few extra frames in there after the action-frame to allow the asp to be fetched (or allow a pause before redirecting to let the database be updated), but I reckon this is the only way you're gonna get it to work the way you describe.

In summary, redirect the user to the loadvariables action when they hit the send button, but test this by adding in frames to give the asp time to update and refetch.

dave dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top