Results 1 to 6 of 6

Thread: password

  1. #1
    Gi Gi Guest

    Default password

    Hello. I have started learning ASP not too long ago. Can someone check these codes for me?? I got error.<BR><BR>Here is my codes:<BR><BR>&#060;%<BR> Dim sql, strUserID, strPassword<BR> <BR> strUserID = Request.Form("userID")<BR> strPassword = Request.Form("password")<BR> <BR> objRS.Open "Student Profile", objConn, 3, 3<BR> <BR> sql = "SELECT * from Student Profile" & _<BR> "where userID = &#039;" & Session("userID") & _<BR> "&#039; AND password = &#039;" & _<BR> "&#039;" & Session("password") & "&#039;;" <BR> <BR> Set objRS = objConn.Execute(sql)<BR> <BR> If(objRS.EOF and objRS.BOF) then<BR> Response.Write " Access Denied!! "<BR> else<BR> Response.Redirect "employOppGrad.asp"<BR> End if<BR>%&#062;<BR><BR>The error said :<BR><BR>Invalid SQL statement. I have to use "SELECT,UPDATE,INSERT,DELETE" statements.<BR><BR>What is the problem???<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: password

    once you&#039;ve finished building the SQL statement, Response.Write() it to the screen. you chould get a better idea of the error that way.

  3. #3
    zain(the dragon) Guest

    Default RE: password

    try using objConn.Execute(sql) instead of Set objRS = objConn.Execute(sql)<BR><BR>and did you create and open the connection object objConn?<BR>Have u defined the session variable Session("UserID") ???<BR>

  4. #4
    Gi Gi Guest

    Default RE: password

    yes. I have created and opened the connection obj objConn. Heres my databaseConn.asp<BR><BR>&#060;head&#062;<BR><BR>&# 060;title&#062;Datastore Connection&#060;/title&#062;<BR>&#060;%<BR>Dim adOpenForwardOnly, adLockOptimistic, adCmdTable<BR>adOpenForwardOnly = 0<BR>adLockOptimistic = 1<BR>adCmdTable = 2<BR><BR>Dim objConn, objRS<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>Set objRS = Server.CreateObject("ADODB.Recordset")<BR><BR>Dim strDatabaseType<BR>&#039;Choose one of the following two lines, and comment out the other <BR>strDatabaseType = "Access"<BR>&#039;strDatabaseType = "MSDE"<BR><BR>&#039;Now we use this selection to open the connection in the appropriate way<BR>If strDatabaseType = "Access" Then<BR> objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _<BR> "Data Source=C:InetpubwwwrootSdpSdp.mdb;" & _<BR> "Persist Security Info=False"<BR>Else<BR> objConn.Open "Provider=SQLOLEDB;Persist Security Info=False;" & _<BR> "User ID=sa;Initial Catalog=Movie;" & _<BR> "Initial File Name=C:MSSQL7DataSdp.mdf"<BR>End If <BR><BR>%&#062;<BR>&#060;/head&#062;<BR><BR>I have defined session variable in my login page.<BR>Is there something wrong???<BR>Thank you. <BR><BR><BR>

  5. #5
    zain ( the dragon ) Guest

    Default RE: password

    try this code<BR><BR>sql="SELECT * FROM StudentProfile WHERE userID="& Session("userID") & " AND password =&#039;" & Session("password) & "&#039;"

  6. #6
    Gi Gi Guest

    Default RE: password doesn&#039;t work. Same error. By the way, what does it mean by...Microsoft JET Database Engine error &#039;80040e14&#039; ??<BR>I&#039;m sorry. I am new to ASP. Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts