ASP Forum
Connection to a database - explanation required
Coder1984 | Posted 6:21am 16. September 2009 Server Time |

Can anyone help me understand this code? I know the beginning is a connection to a database but im not sure about the rest of it, im new to asp.

The code is:


SQL ="Select username,id from tblValidUsers where Username='" & Request.Form("Username") & "'"

RS.Open SQL, Conn, 1, 1

If not rs.EOF then
Dim objUserDetails
Set objUserDetails = Server.CreateObject(Database_Conn.cVerifyPassword")

If objUserDetails.UserValidate(Cstr(Request.Form("domain")))
Then

Set objuserdetails = nothing

Session("ValidUser") = "Yes"
Session("UserID") = RS("id")

Set RSUsername = Server.CreateObject("ADOBD.Recordset")
SQL = "Select Name from tblValidUsers where Username='" & Request.Form("Username")& "'"

RSUsername.Open SQL, Conn, 1, 1
If not RSUsername.EOF then
Session("Name") = RSUsername("Name")
End If

RSUsername.Close

RS.Close
keerthana | Posted 3:42am 29. September 2009 Server Time |

[URL="http://www.google.com/"] click here to know more [/URL]
keerthana | Posted 3:43am 29. September 2009 Server Time |

click here to know more
       [URL="http://www.google.com/"] click here to know more [/URL]
ujanghidayat | Posted 0:36am 2. October 2009 Server Time |

Dear All, I'am beginer for asp script. I need your help to solve my problem. I have a table in MS.Access, there are five fields ( NoID, Name, Class, FirstDay, SecondDay, ThreeDay ). I want to update the third up to fifth field on that table through web page.

here is the code for database connection :

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/newb/db/mytable.mdb"
set rs = Server.CreateObject("ADODB.recordset")
sql="SELECT NoID, Name, Class, FirstDay, SecondDay, ThreeDay  FROM student where"
rs.Open sql, conn
%>

I could show the table on the web page (--showdata.asp ). FYI, the 1st up to the 3rd fields has a data, i mean there's no field to update.

Now I need one page-form to update that field and the result will be placed on "showdata.asp".
Could you help me to solve this problem, please ?

thanks brother....

regards..

Ujang Hidayat
ujanghidayat@gmail.com


Reply to Post Connection to a database - explanation required



Back to Forum Page