Bruce Lim
08-05-2004, 05:45 AM
Hi,
can Anyone help me with this problem?
I had set the format of the webpage using session.lcid=20577
1)i have this Modification form that extract the date from the database into the textbox.
2) User can choose to change or not to change
3) once the form is submited, the data in the database will change accoridng.
4) However, when i go into the same page again and click on the Submit button, the date automatically change as below;
first moodification (click on submit without changing)
Display on text box = 04/05/2004
04/05/2004
second modidification (click on submit without changing)
Display on textbox = 04/05/2004
Result back on main screen =05/04/2004
I am using SQL server 2000 database
Can anyone help me in this area?
THank ALOT
buntine
08-05-2004, 05:54 AM
We should be able to help you out. Though, we will need to see some of your code. I am guessing it is a simple logic error, which you have not picked up on.
Just post some of your code you using to update the date.
Regards,
Andrew Buntine.
Bruce Lim
08-05-2004, 06:01 AM
---------This section is the form section---------------------
<% Option Explicit
Dim Strconnect
session.lcid=2057
Response.Expires =-1000
Response.Buffer =True
StrConnect = "File Name=c:\InetPub\wwwroot\dl\datalink.udl"
%>
<% Dim Sqltmp, formID, rstemp,form_appid,form_appname,form_date,form_cont,form_status,form_fin,DAT
formID = Request.querystring("Which")
sqltmp = "SELECT * FROM tblAppMaster WHERE AppID="& formID
set rstemp = ObjConn.execute(sqltmp)
form_appid = rstemp("AppID")
form_appname = rstemp("AppName")
form_date = rstemp("AppDate")
form_cont = rstemp("AppCont")
form_status = rstemp("AppStatus")
form_fin = rstemp("AppFinRoute")
rstemp.close
set rstemp = Nothing
ObjConn.close
set ObjConn = Nothing
%>
------THE INPUT TEXT BOX EXTRACTING THE DATA FROM THE DATABASE------
<tr>
<td width="7%" bgcolor="#FFFFFF" bordercolor="#FFFFFF">
</td>
<td width="34%" bgcolor="#808080">
<p align="center"><font size="2" face="Arial" color="#FFFFFF">Application Date : </font> </td>
<td width="109%"><font size="1" face="Tahoma"><INPUT TYPE = "TEXT" name="apdate" VALUE ="<%=form_date%>" onFocus="javascript:vDateType='3'" onKeyUp="DateFormat(this,this.value,event,false,'3')" onBlur="DateFormat(this,this.value,event,true,'3')"></font></td>
</tr>
<tr>
--------------Updating record in the Database section-------------
<%
Option Explicit
Dim StrConn
Response.Expires =-1000
Response.Buffer =True
session.lcid=1033
StrConn = "File Name=c:\InetPub\wwwroot\dl\datalink.udl"
%>
<%
Dim ObjComm, intNoOfRecord, form_appid, form_appname, form_appdate, form_isstaff, form_appstatus,form_appfinrout
form_appid= request.form("id")
form_appname= request.form("apname")
form_appdate= request.form("apdate")
form_isstaff= request.form("apstaff")
form_appstatus= request.form("apstatus")
form_appfinrout= request.form("apfinrou")
form_appdate = cDate(FormatDateTime(form_appdate,vbshortdate))
Set ObjComm= Server.CreateObject("ADODB.Command")
ObjComm.ActiveConnection= StrConn
ObjComm.CommandText = "UPDATE tblAppMaster SET AppName='"& form_appname &"',"&_
"AppDate='"& form_appdate &"',"&_
"AppCont='"& form_isstaff &"',"&_
"AppStatus='"& form_appstatus &"',"&_
"AppFinRoute='"& form_appfinrout &"'"&_
"WHERE AppID='"& form_appid &"'"
ObjComm.CommandType= adCmdText
ObjComm.Execute intNoOfRecord
Set ObjComm = Nothing
%>