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"
|