This topic is locked
[SOLVED]

 Current User

1/18/2010 10:31:51 AM
ASPRunnerPro General questions
Y
yahia author

Hello everyone

I just discovered this wonderfull sof (ASPRUN) so i am very new , i am traying to generate a MDB thathave tables like users and invoices

the security set up using users table to log in the project and in the invoice there is a column that is Inserted by

I want that that field have a default value is the cuurent log in user when addng a new invoice, have I to set it that field in add page as readonly ? what exact script i have to put in default value ?

Please help thanks in advance

C
clig 1/18/2010



Hello everyone

I just discovered this wonderfull sof (ASPRUN) so i am very new , i am traying to generate a MDB thathave tables like users and invoices

the security set up using users table to log in the project and in the invoice there is a column that is Inserted by

I want that that field have a default value is the cuurent log in user when addng a new invoice, have I to set it that field in add page as readonly ? what exact script i have to put in default value ?

Please help thanks in advance


a sample on before "add" / "edit" using a DSN
set CN = server.CreateObject("ADODB.Connection")

CN.Open "DSN=dsnname;UID=sa;PWD=sapassword"

set rs = Server.CreateObject("ADODB.Recordset")

rs.Open "insert into LoginHistory (LoginName, LoginDate) values (" & "'" & Session("UserID") & "'" & "," & "'" & Now() & "')", CN

CN.Close

set CN = Nothing

' rs.Close

set rs = Nothing
another using asprunner var
Session("Modified") = SESSION("UserIDName") & " (" & SESSION("UserID") & ")" & " - " & Now()

dict("Modified") = Session("Modified")

dict("Role") = SESSION("UserIDRole")
strSQLInsert = "UPDATE [NTSS_Tickets] SET Modified = " & "'" & Session("Modified") & "'" & " WHERE [TicketNo] = " & Session(strTableName &"_masterkey1")

dbConnection.Execute strSQLInsert

Sergey Kornilov admin 1/19/2010

Set default value to Session("UserID"). You can also set 'Edit as' type to Readonly.

Y
yahia author 1/19/2010



Set default value to Session("UserID"). You can also set 'Edit as' type to Readonly.



THANKS A LOT ADMIN , IT IS SOLVED