Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. access login complete

access login complete

Scheduled Pinned Locked Moved ASP.NET
csharpdebugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jacal99
    wrote on last edited by
    #1

    <%@ Page Language="C#" Debug="True" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> // Insert page code here OleDbConnection oledbCon; void Page_Load(Object sender, EventArgs e) { OleDbConnection oledbCon = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0; DataSource = d:\\access1.mdb"); //oledbCon.Open(); } void login_check(Object sender, EventArgs e) { string uid = txtuser.Text; string upass = txtpass.Text; string strCon = @"Data Source='D:\access1.mdb';Provider='Microsoft.Jet.OLEDB.4.0'"; //"Provider = Microsoft.Jet.OleDb.4.0; Data Source = d:\\access1.mdb" OleDbConnection oledbCon = new OleDbConnection(strCon); OleDbCommand oledbCom = new OleDbCommand("Select fname from users where username = '"+uid+"' and upassword = '"+upass+"' ", oledbCon); oledbCon.Open(); OleDbDataReader dr = oledbCom.ExecuteReader(); if(dr.Read()) { Response.Write("You are logged in"); oledbCon.Close(); string url = Request.QueryString["ReturnUrl"]; if(url==null) url = "main.aspx"; Response.Redirect(url); } else { Response.Write("Your Login Faild Try to Register and then login"); } }

    Access Login

    Username:

    Password:

    Mazhar Hussain

    C 1 Reply Last reply
    0
    • J jacal99

      <%@ Page Language="C#" Debug="True" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> // Insert page code here OleDbConnection oledbCon; void Page_Load(Object sender, EventArgs e) { OleDbConnection oledbCon = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0; DataSource = d:\\access1.mdb"); //oledbCon.Open(); } void login_check(Object sender, EventArgs e) { string uid = txtuser.Text; string upass = txtpass.Text; string strCon = @"Data Source='D:\access1.mdb';Provider='Microsoft.Jet.OLEDB.4.0'"; //"Provider = Microsoft.Jet.OleDb.4.0; Data Source = d:\\access1.mdb" OleDbConnection oledbCon = new OleDbConnection(strCon); OleDbCommand oledbCom = new OleDbCommand("Select fname from users where username = '"+uid+"' and upassword = '"+upass+"' ", oledbCon); oledbCon.Open(); OleDbDataReader dr = oledbCom.ExecuteReader(); if(dr.Read()) { Response.Write("You are logged in"); oledbCon.Close(); string url = Request.QueryString["ReturnUrl"]; if(url==null) url = "main.aspx"; Response.Redirect(url); } else { Response.Write("Your Login Faild Try to Register and then login"); } }

      Access Login

      Username:

      Password:

      Mazhar Hussain

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      And your question is...?


      "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups