Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 20th, 2012, 05:15 AM
Registered User
 
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update date failed

HI,i convert current date format in SQL database as YYYY-MM-DD, after i key in the date as (e.g 2012-11-20), it unavailable to update.

kindly advise, thank you.





<!--#INCLUDE VIRTUAL="/MMS-Test/includes/connection.asp"-->




<%


Dim SystemTime,objRSTime

SystemTime = "SELECT CONVERT (DATE, SYSDATETIME())AS DATE"
Set objRSTime = Server.CreateObject("ADODB.Recordset")
objRSTime.Open SystemTime, oConnection


DIM CurrentTime,EmpID,EmpName,PINVDATE,STRANSID,PVENDO R,PREFNO,PTQTY,PREMARK,EmpLevel
CurrentTime = Request.Form("SystemTime")
EmpID = Request.Form("HEmpID")
EmpName = Request.Form("HEmpName")
EmpLevel = Request.Form("HEmpLevel")
PINVDATE = Request.Form("PINVDATE")
STRANSID = Request.Form("STRANSID")
PVENDOR = Request.Form("PVENDOR")
PREFNO = Request.Form("PREFNO")
PTQTY = Request.Form("PTQTY")
'SREASONID = Request.Form("SREASONID")
PREMARK = Request.Form("PREMARK")


'*************** Check Mandatory Field Start ***************


If TRIM(PINVDATE) = "" and TRIM(PTQTY) = "" Then

Msg = "** Mandatory Field not filled, please check !!!"

Response.Redirect "plan.asp?empid="& EmpID & "&Name=" & EmpName & "&EmpLevel=" & EmpLevel & "&ref=" & Msg



else



If TRIM(PINVDATE) = "CurrentTime" = false THEN

Msg = "** Date not filled, Please Check !!!"


Response.Redirect "plan.asp?empid="& EmpID & "&Name=" & EmpName & "&EmpLevel=" & EmpLevel & "&ref=" & Msg

else


if TRIM(PTQTY) = "" then

Msg = "** Quantity not filled, Please Check !!!"

Response.Redirect "plan.asp?empid="& EmpID & "&Name=" & EmpName & "&EmpLevel=" & EmpLevel & "&ref=" & Msg




'*************** Update Transaction Data Start ***************

'*************** Check Value Stat Start ***************




End if

End if

end if

'*************** Get Latest Transaction ID End ***************



'*************** Update Transaction Qty Data Start ***************



DIM mySQL1

mySQL1 = "INSERT INTO OTH_INV_PLAN (INV_DATE,INV_ID,INV_PLANQTY,INV_VENDORS,INV_PLAN_ REFNO,INV_PLAN_REMARK,INV_PCREATE_DATE,INV_PCREATE _USER) values ('"&PINVDATE&"','"&STRANSID&"','"&PTQTY&"','"&PVEN DOR&"','"&PREFNO&"','"&PREMARK&"',GETDATE(),'"&Emp ID&"')"


DIM objRS1
Set objRS1 = Server.CreateObject("ADODB.Recordset")
objRS1.Open mySQL1, oConnection

Msg = "Plan Quantity Transaction Done !!!"

Response.Redirect "plan.asp?empid="& EmpID & "&Name=" & EmpName & "&EmpLevel=" & EmpLevel & "&ref2=" & Msg



%>


<%
oConnection.Close
Set oConnection = Nothing
%>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Update and insert data Failed caulson Classic ASP Databases 1 January 5th, 2013 02:10 AM
Failed to update database cothedo BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 4 July 29th, 2008 12:14 PM
Wrox Survey Failed to update database beginer_1 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 April 6th, 2007 01:32 PM
Failed to update database edison7 ASP.NET 2.0 Basics 1 June 22nd, 2006 08:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.