a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

database entry using session varibles

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> database entry using session varibles
Page: [1]
 
ACEDISH

 

Posts: 176
Joined: 9/30/2002
From: Manassas, Virginia
Status: offline

 
database entry using session varibles - 1/17/2005 14:57:05   

I can't get this to work, any reccomendations:

In the example below the only field saved is "action" the other 2 that should contaion the session info are blank... I have verified that the sessions were created.



<%
'Create a  Userlog 
Session("username") = Basket
Session("name") = Jimmy

Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then

	Err.Clear

	Set fp_conn =  Server.CreateObject("ADODB.Connection")
	FP_DumpError strErrorUrl, "Cannot create connection"

	Set fp_rs = Server.CreateObject("ADODB.Recordset")
	FP_DumpError strErrorUrl, "Cannot create record set"

	fp_conn.Open Application("userlog_ConnectionString")
	FP_DumpError strErrorUrl, "Cannot open database"

	fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
	FP_DumpError strErrorUrl, "Cannot open record set"

	fp_rs.AddNew
	FP_DumpError strErrorUrl, "Cannot add new record set to the database"
	Dim arFormFields0(3)
	Dim arFormDBFields0(3)
	Dim arFormValues0(3)

	arFormFields0(0) = Session("username")
	arFormDBFields0(0) = "username"
	arFormValues0(0) = Session("username")
	arFormFields0(1) = Session("name")
	arFormDBFields0(1) = "name"
	arFormValues0(1) = Session("name")
	arFormFields0(2) = "action"
	arFormDBFields0(2) = "action"
	arFormValues0(2) = Request("action")
	

	FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


	fp_rs.Update
	FP_DumpError strErrorUrl, "Cannot update the database"

	fp_rs.Close
	fp_conn.Close



End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>


Thanks,
Coz

_____________________________

" Anyone who can only think of one way to spell a word obviously lacks imagination"
BeTheBall

 

Posts: 6385
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: database entry using session varibles - 1/17/2005 17:59:59   
Think you need double quotes:

Session("username") = "Basket"
Session("name") = "Jimmy"

Otherwise, your code expects some variable named Basket and one named Jimmy.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to ACEDISH)
ACEDISH

 

Posts: 176
Joined: 9/30/2002
From: Manassas, Virginia
Status: offline

 
RE: database entry using session varibles - 1/17/2005 18:32:34   
Actually the session part is working, I was just using that as an example>>> my problem is that even though the session exsists i cannot seem to capture and submit it into the database....

In general when creating a database I would usually save the session as a hidden field and submit it to the database. In this case I need to capture it in the query....


Any thoughts?

_____________________________

" Anyone who can only think of one way to spell a word obviously lacks imagination"

(in reply to BeTheBall)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> database entry using session varibles
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts