473,411 Members | 2,210 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,411 software developers and data experts.

Classic ASP Variable Question

polymorphic
I have passed some variables via a querystring to an asp page. The variables are passing ok but when I try to concatenate them into a string sql statement they are not appearing:

For example:

Expand|Select|Wrap|Line Numbers
  1. dim RecordID, callerPage, FlaggerID
  2.  
  3. RecordID = Request("edit")
  4. callerPage = Request("callerPage")
  5. FlaggerID = Request("flagger")
  6.  
  7. 'Response.Write ("flagger is: " & FlaggerID)   '<-------variables will print here!
  8. 'Response.Write ("  /     RecordID is : " & RecordID)
  9.  
  10. if request("act") = "update" then
  11. sql_update = "Update TimeAct set reviewerNotes= '" & replace(request("reviewerNotes"),"'", "''") & "'"
  12. sql_update = sql_update & ", Flagged = 1, FlaggerID = " & FlaggerID & ", FlaggedDate = '" & Now() & "' where [ID] = " & RecordID
  13. response.Write sql_update   '<---------Variables do not show here in this string!
  14. response.end
  15. conn.Execute sql_update
What am I doing wrong? I've tried using a straight Request("flagger") in the concatenation and that did not work.

Thanks,
cj
Jul 25 '07 #1
4 2067
ilearneditonline
130 Expert 100+
Expand|Select|Wrap|Line Numbers
  1. dim RecordID, callerPage, FlaggerID
  2.  
  3. RecordID = Request("edit")
  4. callerPage = Request("callerPage")
  5. FlaggerID = Request("flagger")
  6.  
  7. 'Response.Write ("flagger is: " & FlaggerID) '<-------variables will print here!
  8. 'Response.Write (" / RecordID is : " & RecordID)
  9.  
  10. if request("act") = "update" then
  11. sql_update = "Update TimeAct set reviewerNotes= '" & replace(request("reviewerNotes"),"'", "''") & "'"
  12. sql_update = sql_update & ", Flagged = 1, FlaggerID = " & FlaggerID & ", FlaggedDate = '" & Now() & "' where [ID] = " & RecordID
  13. response.Write sql_update '<---------Variables do not show here in this string!
  14. response.end
  15. conn.Execute sql_update
What am I doing wrong? I've tried using a straight Request("flagger") in the concatenation and that did not work.

Thanks,
cj
Are you sure this is happening? If I comment this out, I can get the code to display properly.

Expand|Select|Wrap|Line Numbers
  1.  if request("act") = "update" then
Jul 25 '07 #2
Are you sure this is happening? If I comment this out, I can get the code to display properly.

Expand|Select|Wrap|Line Numbers
  1.  if request("act") = "update" then
The SQL output I get is:

Update TimeAct set reviewerNotes= 'ddd', Flagged = 1, FlaggerID = , FlaggedDate = '7/25/2007 2:37:26 PM' where [ID] =

If I change the code to:

Expand|Select|Wrap|Line Numbers
  1. sql_update = "Update TimeAct set reviewerNotes= '" & replace(request("reviewerNotes"),"'", "''") & "'"
  2. sql_update = sql_update & ", Flagged = 1, 
  3. FlaggerID = " & Request.Form("FlaggerID") & 
  4. ", FlaggedDate = '" & Now() & "' where [ID] = " 
  5. & Request.Form("RecordID")
then I can get the ID to pull:

Update TimeAct set reviewerNotes= 'ddd', Flagged = 1, FlaggerID = , FlaggedDate = '7/25/2007 2:37:26 PM' where [ID] = 39987

I am calling the page and passing these values as:

Expand|Select|Wrap|Line Numbers
  1. <A ID="<%=flagName%>" HREF="javascript:void();" onClick="popWin('/timesheet_Flag.asp?edit=<%=rs.Fields("ID")%>&callerPage=review&flagger=<% = FlaggerID%>', 'TimesheetFlag', 700,650); return false;">flag</A> <br>
I don't know what is unique to the FlaggerID that the value is not appearing in the derived sql.
Jul 25 '07 #3
ilearneditonline
130 Expert 100+
Except for the fact that I am not calling your page from a javascript popup, I have copied your code and get the results I would expect. Are you leaving out part of the code? Such as something between lines 8 and 10 that you previously displayed?
Jul 25 '07 #4
jhardman
3,406 Expert 2GB
just a hunch; do you have option explicit?

Jared
Jul 26 '07 #5

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

Similar topics

1
by: A Ratcliffe | last post by:
Hopefully just a couple of quick quick questions/responses, but its not something I've generally had trouble with in the past. Unfortunately, I need answers ASAP if anyone is available to help. ...
2
by: Wynter | last post by:
I've been smacking into one brick wall after the next in converting some of my code from ASP Classic to ASP.NET. This one is a real bugger. I use Session Variables to help with User Security. If they...
99
by: Jim Hubbard | last post by:
It seems that Microsoft not only does not need the classic Visual Basic developer army (the largest army of developers the world has ever seen), but now they don't need ANY Windows developer at a...
6
by: ASPfool | last post by:
Hello everyone, Please help me before I throw my computer out of the window: I'm working on a web application in classic ASP (vbscript), which is making calls to some webservices. The calls...
1
by: jason | last post by:
i'm working on a gradual conversion of an ASP classic web site to ASP.NET. a recent body of work involves adding a new asp page to the existing site. i thought this would be a good opportunity to...
4
by: jason | last post by:
i'm working on a gradual conversion of an ASP classic web site to ASP.NET. a recent body of work involves adding a new asp page to the existing site. i thought this would be a good opportunity to...
9
by: KenLee | last post by:
I made an application which includes classic asp page and asp.net page. when I tried to redirect from classic asp page to asp.net 2.0 page, it works under my local IIS directory. ex) <a...
3
by: =?Utf-8?B?UmFnYQ==?= | last post by:
Hi, We have found a very freakish ‘truncate’ behavior in Classic ASP application (that is called from within a web logic portal). We have an ASP variable, lngOrderId (an oracle sequence...
1
by: Madhusudana Babu | last post by:
IMy classic ASP app has a global.asa file in the root directory of the app 'SDT'. I have set an application variable there: <SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Application_OnStart ...
11
by: Jan T. | last post by:
I wonder if anybody know a web site that has a good tutorial on this subject. What I want to do, is make a log in Page, and make sure that all my pages is validating that the user is loged in...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...
0
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...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.