473,763 Members | 6,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

session issues

102 New Member
[PHP]<%
If Session("userna me") = "" Then
Response.Redire ct("/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={My SQL ODBC 3.51 Driver};SERVER= " & db_server & ";DATABASE= " & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

Set conn = Server.CreateOb ject("ADODB.Con nection")
conn.Open connectstr

'---------------------------------
dim part, fdate,desc,pic, p,p2,p3,p4,p5,p 6, a,a2,a3,a4,a5,a 6,suc,suc2,suc3 ,suc4,suc5,suc6 ,cc,cc2,cc3,cc4 ,cc5,cc6, soc,soc2,soc3,s oc4,soc5,soc6


session("part") = request.form("P art")
session("fdate" )= Request.form("F Adate")
session("desc") = Request.form("D esc")
session("pic")= Request.form("m yFile")
session("p")= Request.form("p lan1")
session("p2") = Request.form("p lan2")
session("p3") = Request.form("p lan3")
session("p4") = Request.form("p lan4")
session("p5") = request.form("p lan5")
session("p6") = Request.form("p lan6")
session("a") = Request.form("a ctual1")
session("a2") = Request.form("a ctual2")
session("a3") = Request.form("a ctual3")
session("a4") = Request.form("a ctual4")
session("a5") = Request.form("a ctual5")
session("a6") = Request.form("a ctual6")
session("suc") = request.form("S uppCom")
session("suc2") = Request.form("S uppCom2")
session("suc3") = Request.form("S uppCom3")
session("suc4") = Request.form("S uppCom4")
session("suc5") = Request.form("S uppCom5")
session("suc6") = Request.form("S uppCom6")
session("cc") = Request.form("C ustCom")
session("cc2") = Request.form("C ustCom2")
session("cc3") = request.form("C ustCom3")
session("cc4") = Request.form("C ustCom4")
session("cc5") = Request.form("C ustCom5")
session("cc6") = Request.form("C ustCom6")
session("soc") = Request.form("S ourceCom")
session("soc2") = Request.form("S ourceCom2")
session("soc3") = Request.form("S ourceCom3")
session("soc4") = Request.form("S ourceCom4")
session("soc5") = Request.form("S ourceCom5")
session("soc6") = Request.form("S ourceCom6")

'-----------------------------------------------------------------
if session("part") = "" then
response.redire ct("WeeklyRepor t.asp?res=blank Part")
end if

dim qrycheck, rscheck
qrycheck="selec t PartNumber from weeklyreport where PartNumber="&se ssion("part")&" "
set rscheck = conn.execute(qr ycheck)


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




if not rscheck.eof then
response.redire ct("WeeklyRepor t.asp?res=exist ")

elseif session("fdate" ) = "" then
response.redire ct("WeeklyRepor t.asp?res=blank Date")

elseif session("desc") = "" then
response.redire ct("WeeklyRepor t.asp?res=blank Desc")

elseif session("part") = "" then
response.redire ct("WeeklyRepor t.asp?res=blank ")

elseif session("p") = "" then
response.redire ct("WeeklyRepor t.asp?res=blank PlanDate")

elseif session("p2") = "" then
response.redire ct("WeeklyRepor t.asp?res=blank PlanDate")

elseif session("p3") = "" then
response.redire ct("WeeklyRepor t.asp?res=blank PlanDate")

elseif session("p4") = "" then
response.redire ct("WeeklyRepor t.asp?res=blank PlanDate")

elseif session("p5") = "" then
response.redire ct("WeeklyRepor t.asp?res=blank PlanDate")




'-----------------------------------------------------------------
elseif cdate (session("p")) > cdate (session("fdate ")) then
response.redire ct("WeeklyRepor t.asp?res=dateO ver")

else if cdate (session("p2")) > cdate (session("fdate ")) then
response.redire ct("WeeklyRepor t.asp?res=dateO ver")

elseif cdate (session("p3")) > cdate (session("fdate ")) then
response.redire ct("WeeklyRepor t.asp?res=dateO ver")

elseif cdate (session("p4")) > cdate (session("fdate ")) then
response.redire ct("WeeklyRepor t.asp?res=dateO ver")

elseif cdate(session(" p5")) > cdate(session(" fdate")) then
response.redire ct("WeeklyRepor t.asp?res=dateO ver")



elseif cdate(session(" a")) > cdate(session(" p")) then
response.redire ct("WeeklyRepor t.asp?res=Actua lOverPlan")

elseif cdate(session(" a2")) > cdate(session(" p2")) then
response.redire ct("WeeklyRepor t.asp?res=Actua lOverPlan")

elseif cdate(session(" a3")) > cdate(session(" p3")) then
response.redire ct("WeeklyRepor t.asp?res=Actua lOverPlan")

elseif cdate(session(" a4")) > cdate(session(" p4")) then
response.redire ct("WeeklyRepor t.asp?res=Actua lOverPlan")

elseif cdate(session(" a5")) > cdate(session(" fdate")) then
response.redire ct("WeeklyRepor t.asp?res=Actua lOverPlan")

else


dim rsInsert, qryInsert

qryInsert = "insert into weeklyreport (PartNumber,FA_ Date,Descriptio n,Image_Path,Pl an1,Plan2,Plan3 ,Plan4,Plan5,Pl an6, Actual1,Actual2 ,Actual3,Actual 4,Actual5,Actua l6,Supp_comm,Su pp_comm2,Supp_c omm3, Supp_comm4,Supp _comm5,Supp_com m6, Cust_comm,Cust_ comm2,Cust_comm 3,Cust_comm4,Cu st_comm5,Cust_c omm6, Sourcing_comm,S ourcing_comm2,S ourcing_comm3,S ourcing_comm4,S ourcing_comm5, Sourcing_comm6)
values("&sessio n("part")&","&s ession("fdate") &","&session("d esc")&","&sessi on("pic")&", "&session("p")& ","&session("p2 ")&","&session( "p3")&","&sessi on("p4")&","&se ssion("p5") &","&session("a ")&","&session( "a2")&","&sessi on("a3")&","&se ssion("a4")&"," &session("a5 ") &","&session("a 6")&","&session ("suc")&","&ses sion("suc2")&", "&session("suc3 ")&"," &session("suc4" )&","&session(" suc5")&","&sess ion("cc")&","&s ession("cc2")&" ,"
&session("cc3") &","&session("c c4")&","&sessio n("cc5")&","&se ssion("cc6")&", " &session("soc") &","&session("s oc2")&","&sessi on("soc3")&","& session("soc4") &"," &session("soc5" )&","&session(" soc6")&")"

set rsInsert = conn.execute(qr yInsert)


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.redire ct("WeeklyRepor t.asp?res=creat ed")

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.a sp, line 146 [/PHP]

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

i declared the date as varchar(45) .. it works fine previously..pls help thanks..
Jun 27 '07 #1
5 2435
jhardman
3,406 Recognized Expert Specialist
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 New Member
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 Recognized Expert Contributor
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 New Member
[quote=improvcor nartist]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 Recognized Expert Contributor
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
7988
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 : VBScript and Javascript Client : 1. IE browser. 2. VBForm embedded with WebBrowser control (MS Internet
5
2200
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 me to toss my assemblies into. We keep loosing session state every few months. People have told me that my app could be running out of memory, causing the sessions to get reset. Well, if this is the case, then when I go to the page again,...
1
2001
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 environment. Currently the application has a search customers page with 10 search fields which list the results below the search fields. The requirement for this screen was that the user could return to this result page at any point from any page...
4
3744
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 on my system. I would like to be able to access the session of the user that submitted the order, and clear their basket. I don't really want to store their session in the database just to facilitate this.
26
3616
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 opens a new IE window with Ctrl-N or File-New-Window, BOTH WINDOWS SHARE THE SAME SESSION VARIABLES. This cannot be prevented.
13
2102
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
6098
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
5360
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 dont wan't a single point of failure we use SQL Session State. I have setup a persistant sql session state database on a SQL 2000 server (this is a cluster in production, so no SPOF) I have setup our web.config files to include; " <sessionState...
13
8673
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 a login to show data. I want the user to login only once when he visits any of my domains.
5
5900
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 about asp.net session state service? -Billy
0
9387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10002
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.