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!

ASP on Windows NT 1

Status
Not open for further replies.

ikramissa

Programmer
May 15, 2001
4
US
i have created a web page in windows 98 using PWS, as the web server, which uses access 97 database.
i have a problem when i run it on the windows NT server which uses iis.
the problem is i have a calendar, from which the user can enter an event,
the user clicks on the date, and then enters the text into a text box, which when submitted is calls a addevent.asp page, which adds the contents into the database, and then redirects it back to the calendar, which finds the event entered and displays the date in the calendar as red,( so the user knows that a date has been entered)
but when i run this on windows NT, the data is entered into the database, as it should. but when the calendar page is loaded, the calendar date sometimes changes red and some times it does not, and if it does not, i click on refresh page and hey presto the date turns red.
the problem i am having is that for some reason, sometimes the database is not updated by the time the calendar page loads up.
i do not know if this is a problem someone else has encounterd, or it is a problem with my coding, or if it is the problem with the server.
can some one please help me.
the code i have in addevent is

<%@ Language=VBScript %>
<%
set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
strConnection = &quot;DSN=contact;&quot;
strConnection = strConnection & &quot;UID=;PWD=;&quot;
Conn.Open strConnection

Dim strName, tmpdate,tmptext
strName = Request.Cookies(&quot;UserName&quot;)
tmpdate = FormatDateTime(Request(&quot;EventDate&quot;), vbShortDate)
tmptext = Trim(Request(&quot;EventText&quot;))

if tmptext <> &quot;&quot; then
Set RSAddEvent = Server.CreateObject(&quot;ADODB.Recordset&quot;)
strQuery = &quot;INSERT INTO Events (username, eventtext, eventdate)VALUES ('&quot;&strname&&quot;', '&quot;&tmptext&&quot;','&quot;&tmpdate&&quot;')&quot;

RSAddEvent.Open strQuery, strConnection, adopenstatic
Response.Redirect(&quot;cal1.asp?EventDate=&quot; & (Request(&quot;EventDate&quot;)) & &quot;&quot;)
else
Response.Redirect(&quot;cal1.asp&quot;)
end if

RSAddEvent.close
Set RSAddEvent = Nothing
%>
 
Sounds to me like you have got caching problems. It seems that when you page is loaded up the second time round, you are getting the cached version instead of the new asp generated version.

To get around this, add the following code to the start of every page you don't want to be cached.

<%
Response.Expires = 15
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader &quot;pragma&quot;,&quot;no-cache&quot;
Response.AddHeader &quot;cache-control&quot;,&quot;private&quot;
Response.CacheControl = &quot;no-cache&quot;
%>

This was grabbed from an earlier post so I don't know if it work.

Hope this helps.
 
nope i have tried the caching
it has not cured the problem
i have changed the caching interval as well.
also the thing is that the problem happens sometimes and not all the time, so i doubt it its the caching
or something else i am doing wrong
 
I don't know if this is it, but I personally have never seen insert sql as a recordset query.

instead of using the Recordset to update the database, why not just use the connection.

ex:
Conn.Execute strQuery


That might be the problem... at any rate, if it doesn't fix it, it also saves the server some overhead and some processing time (since it doesn't need to allocate space for the recordset).

Also - since you are using Access as your backend, you need to encapsulate any date files with #. ex: #05/05/01#. SQL Server allows you to use ' marks, but Access gets real picky and doesn't like those around dates.

Other than those two things, I really have no idea what the problem might be. Everything else looks like it's fine.

good luck
leo
 
nope i am still having the same problem i really do not know what the problem is
i need helllllllppppppp
 
try just a simple <meta> tag for refreshing the page every time. Put it in every page. Just a thought...

<META HTTP-EQUIV=&quot;Expires&quot; CONTENT=&quot;Tue, 04 Dec 1993 21:29:02 GMT&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top