Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
I can't make sense of this!
Old 06-25-2008, 09:09 AM I can't make sense of this!
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
This AJAX server code returns a correct CustID:
Code:
 
<%
CustID=Session.Contents("CustID")
RecNum=Request.QueryString("RecNum")
Qty=Request.QueryString("Qty")
'Set conn=Server.CreateObject("ADODB.Connection")
'conn.Provider="Microsoft.Jet.OLEDB.4.0"
'conn.Open ("c:/inetpub/wwwroot/HawksWeb/Data/WebData.mdb")
'Set Items = Server.CreateObject("ADODB.RecordSet")
'Items.ActiveConnection = conn
'Items.Open("Select ProdID From Cart where CustId='"&CustID&"'")
'Items.Move(RecNum,1)
'ProdID = Items.Fields("ProdID")
'Items.close
'Set Items=nothing
'Items.Execute "Update Cart Set Qty='"&Qty&"' Where ProdID='"&ProdID&"' and CustID='"&CustID&"'"
'conn.close
'Set conn = nothing
Response.Write(CustID)
%>
This code, however returns Qty:
Code:
 
<%
CustID=Session.Contents("CustID")
RecNum=Request.QueryString("RecNum")
Qty=Request.QueryString("Qty")
Set conn=Server.CreateObject("ADODB.Connection")
'conn.Provider="Microsoft.Jet.OLEDB.4.0"
'conn.Open ("c:/inetpub/wwwroot/HawksWeb/Data/WebData.mdb")
'Set Items = Server.CreateObject("ADODB.RecordSet")
'Items.ActiveConnection = conn
'Items.Open("Select ProdID From Cart where CustId='"&CustID&"'")
'Items.Move(RecNum,1)
'ProdID = Items.Fields("ProdID")
'Items.close
'Set Items=nothing
'Items.Execute "Update Cart Set Qty='"&Qty&"' Where ProdID='"&ProdID&"' and CustID='"&CustID&"'"
'conn.close
'Set conn = nothing
Response.Write(CustID)
%>
I hope this makes sense to someone!
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-25-2008, 02:19 PM Re: I can't make sense of this!
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
That's not AJAX. A = Asynchronous, J = Javascript, A = And, X = XML. It looks like you're just writing numerical values. If you wrote out an XML document, you wouldn't need to make 2 calls.

Why are you creating a connection to the database, in order to write session values?

I hope to God you aren't planning to "turn on" (uncomment) that code! If you run updates against your database from query string parameters, you're begging to get hacked back to the stone age!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-25-2008, 02:41 PM Re: I can't make sense of this!
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Yeah, Ok and all that jazz... Why does

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

change my response.write?
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I can't make sense of this!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11400 seconds with 12 queries