Monday, December 17, 2007

How to edit a record in the table (Using SQL command)

How to edit a record in the table (Using SQL command)

S T E P - 1

- We need to create a Connection:

<%

Dim oConn

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

oConn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db1.mdb")

%>

S T E P - 2

- Use .Execute method to perform the SQL command:

<%

Dim strSQL

strSQL = "UPDATE member SET " & _

"'Email='" & Request.Form("Email") & _

"', Gender='" & Request.Form("Gender") & _

"', AccessLevel='" & Request.Form("AccessLevel") & _

"' WHERE MemberID='" & Request.Form("MemberID") & "';"

oConn.Execute strSQL

oConn.Close

Set oConn = Nothing

%>

How to collect the value of a multiple values from HTML Check Box

How to collect the value of a multiple values from HTML Check Box

S T E P - 1

- When you use some Check Boxes in your HTML form, they are using the same name but different values:

Value1

Value2

Value3

Value4


- When you send the form, the Form collection will generate a multi-value option for the CheckBox.

S T E P - 2

- Now, we can use For..loop to get the multi values:

<%

If Request.form("SameName").Count Then

For intLoop = 1 to Request.form("SameName").Count

Response.write (intLoop & ". " & Request.form("SameName")(intLoop) & "
")

Next

End If

%>


How to make the Cookies more secure

How to make the Cookies more secure

S T E P - 1

- We can setup the Cookies that only your web server can accept it:

<%

Response.cookies("YourCookies").domain = "/www.abc.com/"

%>

S T E P - 2

- The path (or folder) can also use it:

<%

Response.cookies("YourCookies").domain = "/myAsp"

%>

S T E P - 3

- We can set the Cookies which can only transfer to the web server by using the SSL(Secure Sockets Layer) :

<%

Response.cookies("YourCookies").secure = True

%>


How to make the Cookies more secure

How to make the Cookies more secure

S T E P - 1

- We can setup the Cookies that only your web server can accept it:

<%

Response.cookies("YourCookies").domain = "/www.abc.com/"

%>

S T E P - 2

- The path (or folder) can also use it:

<%

Response.cookies("YourCookies").domain = "/myAsp"

%>

S T E P - 3

- We can set the Cookies which can only transfer to the web server by using the SSL(Secure Sockets Layer) :

<%

Response.cookies("YourCookies").secure = True

%>