473,387 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

session issues

102 100+
[PHP]<%
If Session("username") = "" Then
Response.Redirect("/CLS/Login.asp")
End If

Dim conn
Dim connectstr
Dim db_name, db_username, db_userpassword
Dim db_server
Dim res

db_server = "localhost"
db_name = "cls1"
db_username = "root"
db_userpassword = "newpwd"

connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connectstr

'---------------------------------
dim part, fdate,desc,pic,p,p2,p3,p4,p5,p6, a,a2,a3,a4,a5,a6,suc,suc2,suc3,suc4,suc5,suc6,cc,c c2,cc3,cc4,cc5,cc6, soc,soc2,soc3,soc4,soc5,soc6


session("part")= request.form("Part")
session("fdate")= Request.form("FAdate")
session("desc")= Request.form("Desc")
session("pic")= Request.form("myFile")
session("p")= Request.form("plan1")
session("p2") = Request.form("plan2")
session("p3") = Request.form("plan3")
session("p4") = Request.form("plan4")
session("p5") = request.form("plan5")
session("p6") = Request.form("plan6")
session("a") = Request.form("actual1")
session("a2") = Request.form("actual2")
session("a3") = Request.form("actual3")
session("a4") = Request.form("actual4")
session("a5") = Request.form("actual5")
session("a6") = Request.form("actual6")
session("suc") = request.form("SuppCom")
session("suc2") = Request.form("SuppCom2")
session("suc3") = Request.form("SuppCom3")
session("suc4") = Request.form("SuppCom4")
session("suc5") = Request.form("SuppCom5")
session("suc6") = Request.form("SuppCom6")
session("cc") = Request.form("CustCom")
session("cc2") = Request.form("CustCom2")
session("cc3") = request.form("CustCom3")
session("cc4") = Request.form("CustCom4")
session("cc5") = Request.form("CustCom5")
session("cc6") = Request.form("CustCom6")
session("soc") = Request.form("SourceCom")
session("soc2") = Request.form("SourceCom2")
session("soc3") = Request.form("SourceCom3")
session("soc4") = Request.form("SourceCom4")
session("soc5") = Request.form("SourceCom5")
session("soc6") = Request.form("SourceCom6")

'-----------------------------------------------------------------
if session("part") = "" then
response.redirect("WeeklyReport.asp?res=blankPart" )
end if

dim qrycheck, rscheck
qrycheck="select PartNumber from weeklyreport where PartNumber="&session("part")&""
set rscheck = conn.execute(qrycheck)


'----------------------------------------------------------------




if not rscheck.eof then
response.redirect("WeeklyReport.asp?res=exist")

elseif session("fdate") = "" then
response.redirect("WeeklyReport.asp?res=blankDate" )

elseif session("desc") = "" then
response.redirect("WeeklyReport.asp?res=blankDesc" )

elseif session("part") = "" then
response.redirect("WeeklyReport.asp?res=blank")

elseif session("p") = "" then
response.redirect("WeeklyReport.asp?res=blankPlanD ate")

elseif session("p2") = "" then
response.redirect("WeeklyReport.asp?res=blankPlanD ate")

elseif session("p3") = "" then
response.redirect("WeeklyReport.asp?res=blankPlanD ate")

elseif session("p4") = "" then
response.redirect("WeeklyReport.asp?res=blankPlanD ate")

elseif session("p5") = "" then
response.redirect("WeeklyReport.asp?res=blankPlanD ate")




'-----------------------------------------------------------------
elseif cdate (session("p")) > cdate (session("fdate")) then
response.redirect("WeeklyReport.asp?res=dateOver")

else if cdate (session("p2")) > cdate (session("fdate")) then
response.redirect("WeeklyReport.asp?res=dateOver")

elseif cdate (session("p3")) > cdate (session("fdate")) then
response.redirect("WeeklyReport.asp?res=dateOver")

elseif cdate (session("p4")) > cdate (session("fdate")) then
response.redirect("WeeklyReport.asp?res=dateOver")

elseif cdate(session("p5")) > cdate(session("fdate")) then
response.redirect("WeeklyReport.asp?res=dateOver")



elseif cdate(session("a")) > cdate(session("p")) then
response.redirect("WeeklyReport.asp?res=ActualOver Plan")

elseif cdate(session("a2")) > cdate(session("p2")) then
response.redirect("WeeklyReport.asp?res=ActualOver Plan")

elseif cdate(session("a3")) > cdate(session("p3")) then
response.redirect("WeeklyReport.asp?res=ActualOver Plan")

elseif cdate(session("a4")) > cdate(session("p4")) then
response.redirect("WeeklyReport.asp?res=ActualOver Plan")

elseif cdate(session("a5")) > cdate(session("fdate")) then
response.redirect("WeeklyReport.asp?res=ActualOver Plan")

else


dim rsInsert, qryInsert

qryInsert = "insert into weeklyreport (PartNumber,FA_Date,Description,Image_Path,Plan1,P lan2,Plan3,Plan4,Plan5,Plan6, Actual1,Actual2,Actual3,Actual4,Actual5,Actual6,Su pp_comm,Supp_comm2,Supp_comm3, Supp_comm4,Supp_comm5,Supp_comm6, Cust_comm,Cust_comm2,Cust_comm3,Cust_comm4,Cust_co mm5,Cust_comm6, Sourcing_comm,Sourcing_comm2,Sourcing_comm3,Sourci ng_comm4,Sourcing_comm5, Sourcing_comm6)
values("&session("part")&","&session("fdate")&","& session("desc")&","&session("pic")&", "&session("p")&","&session("p2")&","&session("p3") &","&session("p4")&","&session("p5") &","&session("a")&","&session("a2")&","&session("a 3")&","&session("a4")&","&session("a5") &","&session("a6")&","&session("suc")&","&session( "suc2")&","&session("suc3")&"," &session("suc4")&","&session("suc5")&","&session(" cc")&","&session("cc2")&","
&session("cc3")&","&session("cc4")&","&session("cc 5")&","&session("cc6")&"," &session("soc")&","&session("soc2")&","&session("s oc3")&","&session("soc4")&"," &session("soc5")&","&session("soc6")&")"

set rsInsert = conn.execute(qryInsert)


session("part")= ""
session("fdate")= ""
session("desc")= ""
session("pic")= ""
session("p") = ""
session("p2") = ""
session("p3") = ""
session("p4") = ""
session("p5") = ""
session("p6") = ""
session("a ") = ""
session("a2 ") = ""
session("a3") = ""
session("a4") = ""
session("a5") = ""
session("a6") = ""
session("suc") = ""
session("suc2") = ""
session("suc3") = ""
session("suc4") = ""
session("suc5") = ""
session("suc6") = ""
session("cc") = ""
session("cc2") = ""
session("cc3") = ""
session("cc4") = ""
session("cc5") = ""
session("cc6") = ""
session("soc") = ""
session("soc2") = ""
session("soc3") = ""
session("soc4") =""
session("soc5") = ""
session("soc6") =""


response.redirect("WeeklyReport.asp?res=created")

end if
end if

%>[/PHP]
before i use session ... all data can go in to database... but after i use session .. below is the error..

[PHP]
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '06/05/2007,06/07/2007,06/11/2007,06/04/2007,06/05/2007,06/01/2007,06/01/2007,06/' at line 1

/CLS1/WeeklyReport/WeeklyReport2.asp, line 146 [/PHP]

line 146 is
[PHP]set rsInsert = conn.execute(qryInsert)[/PHP]

i declared the date as varchar(45) .. it works fine previously..pls help thanks..
Jun 27 '07 #1
5 2416
jhardman
3,406 Expert 2GB
the difference has to be in qryInsert. Try the following with and without the session variables:
Expand|Select|Wrap|Line Numbers
  1. response.write "<!-- qryInsert: " & qryInsert & " -->" & vbNewLine
Does this line print exactly the same in both cases? Tell me what you get.

Jared
Jun 27 '07 #2
lyealain
102 100+
the difference has to be in qryInsert. Try the following with and without the session variables:
Expand|Select|Wrap|Line Numbers
  1. response.write "<!-- qryInsert: " & qryInsert & " -->" & vbNewLine
Does this line print exactly the same in both cases? Tell me what you get.

Jared
i don understand what u meant.. u meant try not to put in qryInsert??
Jun 27 '07 #3
improvcornartist
303 Expert 100+
Have you tried placing the session variables within quotes in qryInsert (line 144)?

Expand|Select|Wrap|Line Numbers
  1. qryInsert = "insert into weeklyreport (PartNumber, FA_Date, Description, Image_Path, Plan1, Plan2, Plan3, Plan4, Plan5, Plan6, Actual1, Actual2, Actual3, Actual4, Actual5, Actual6, Supp_comm, Supp_comm2, Supp_comm3, Supp_comm4, Supp_comm5, Supp_comm6, Cust_comm, Cust_comm2, Cust_comm3, Cust_comm4, Cust_comm5, Cust_comm6, Sourcing_comm, Sourcing_comm2, Sourcing_comm3, Sourcing_comm4, Sourcing_comm5, Sourcing_comm6) values("' & session("part") & "', '" & session("fdate") & "','" & session("desc") & "','" & session("pic") & "','" & session("p") & "','" & session("p2") & "','" & session("p3") & "','" & session("p4") & "','" & session("p5") & "','" & session("a") & "','" & session("a2") & "','" & session("a3") & "','" & session("a4") & "','" & session("a5") & "','" & session("a6") & "','" & session("suc") & "','" & session("suc2") & "','" & session("suc3") & "','" & session("suc4") & "','" & session("suc5") & "','" & session("cc") & "','" & session("cc2") & "','" & session("cc3") & "','" & session("cc4") & "','" & session("cc5") & "','" & session("cc6") & "','" & session("soc") & "','" & session("soc2") & "','" & session("soc3") & "','" & session("soc4") & "','" & session("soc5") & "','" & session("soc6") & "')"
Jun 27 '07 #4
lyealain
102 100+
[quote=improvcornartist]Have you tried placing the session variables within quotes in qryInsert (line 144)?

thanks for reply..!!! .. but what do u meant by placing the session variable within quotes in qryInsert??? wht is the quotes for session???
Jun 27 '07 #5
improvcornartist
303 Expert 100+
thanks for reply..!!! .. but what do u meant by placing the session variable within quotes in qryInsert??? wht is the quotes for session???
I mean using single quotes in your qryInsert, like I did in the code I posted in my other reply.
Jun 27 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script :...
5
by: ASP.Confused | last post by:
As you can tell from my previous posts on this issue...I'm really confused :-/ I have a few ASP.NET web applications on my web host's "https" server. Our web host has a single "bin" folder for...
1
by: Larry Neylon | last post by:
Hi, I'm working on a VBScript application on IIS6 and I'm looking for some advice about the best way of replacing or improving session variable usage. The application is in a secure extranet...
4
by: Nick Gilbert | last post by:
Hi, Is it possible to access the Session of an arbitary user from an aspx page? On an e-commerce site, I am notified of payment success via a callback from the payment server to an ASPX page...
26
by: BillE | last post by:
Some ASP.NET applications use Session Variables extensively to maintain state. These should be re-written to use viewstate, hidden fields, querystring, etc. instead. This is because if a user...
13
by: Laurahn | last post by:
How can i configure my application for closing the session ? How can i use the session end for closing the session ?
25
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
8
by: Andrew Teece | last post by:
Hope someone can help. We are trying to deploy an ASP.Net 2.0 application to a 3-node webfarm. The application uses the ReportViewer control in local mode, hence we need session state. Because we...
13
by: Samir Chouaieb | last post by:
Hello, I am trying to find a solution to a login mechanism for different domains on different servers with PHP5. I have one main domain with the user data and several other domains that need...
5
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
Hi All, I am using asp.net session state service to store session. The concurrent online user will be almost 2000. Could asp.net session state service afford this? Is there any limitation...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.