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. how to connect access database on web server

how to connect access database on web server

Scheduled Pinned Locked Moved ASP.NET
databasesysadminhelptutorialquestion
4 Posts 3 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.
  • D Offline
    D Offline
    Dhrumil_Shukla
    wrote on last edited by
    #1

    Hi All, I M trying to connect to access database it is done and working perfectly in my local machine. But when i upload the pages to web server it is retrieving the data from database but does not allow saving the data so could you please tell me how can i solve this problem. Thanks in advance.

    R A 2 Replies Last reply
    0
    • D Dhrumil_Shukla

      Hi All, I M trying to connect to access database it is done and working perfectly in my local machine. But when i upload the pages to web server it is retrieving the data from database but does not allow saving the data so could you please tell me how can i solve this problem. Thanks in advance.

      R Offline
      R Offline
      rj shukla
      wrote on last edited by
      #2

      Define any web form, then you established connection with any provider after this create command for accessing query and finaly define datareader class. using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb; public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=c:/db1.mdb;"); con.Open(); OleDbCommand cmd = new OleDbCommand("select *from login", con); OleDbDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { if (TextBox1.Text == dr.GetString(0)) if (TextBox2.Text == dr.GetString(1)) Response.Redirect("default2.aspx"); else lbl.Text="check the username and password"; CheckBox1.Text = "check the username and password"; } //con.Close(); } protected void LinkButton1_Click(object sender, EventArgs e) { } }

      1 Reply Last reply
      0
      • D Dhrumil_Shukla

        Hi All, I M trying to connect to access database it is done and working perfectly in my local machine. But when i upload the pages to web server it is retrieving the data from database but does not allow saving the data so could you please tell me how can i solve this problem. Thanks in advance.

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Dhrumil_Shukla wrote:

        web server it is retrieving the data from database but does not allow saving the data

        Its means your connection string is not valid. Do you have the database on web server or any different system ? What your connectionString contains?

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

        D 1 Reply Last reply
        0
        • A Abhijit Jana

          Dhrumil_Shukla wrote:

          web server it is retrieving the data from database but does not allow saving the data

          Its means your connection string is not valid. Do you have the database on web server or any different system ? What your connectionString contains?

          Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

          D Offline
          D Offline
          Dhrumil_Shukla
          wrote on last edited by
          #4

          my datbase is on web server and the connectionstring is like "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|table.mdb;Persist Security Info=True"

          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