Database is not storing data

Last post 05-28-2008 11:13 AM by jchandra. 31 replies.

Sort Posts:

  • Database is not storing data

    05-16-2008, 2:34 PM
    • Loading...
    • arshadtop
    • Joined on 01-22-2007, 5:02 PM
    • India
    • Posts 285

    Hi,

    I am storing database from my website using OLEDB connection for ACCESS Database. When i press the button to save the data it not storing anything into the database.

     Look at the connection string:

    Conn.Connectingstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Sever.Mappath("Mydatabase.mdb") 

     I haven't specified  "User Id=admin;Password=;"  with the connection string. I would like to ask you, is it neccessary to use userid and password to the connection string or is there any other cause that the data is not storing into the database.

    Thanks.

    Best Regards

    Arshad 

    Please Mark as Answer if the post is helpful to you.
  • Re: Database is not storing data

    05-16-2008, 2:41 PM
    • Loading...
    • Curt_C
    • Joined on 07-23-2003, 4:27 PM
    • Stevens Point, WI - USA
    • Posts 4,285
    • Moderator

    I doubt that Sever.Mappath("Mydatabase.mdb") is returning the right path for you...

    Where is your db?

    1) put it in the App_Data folder.
    2) try Sever.Mappath("~/") & "App_Data/Mydatabase.mdb"

    Curt Christianson
  • Re: Database is not storing data

    05-16-2008, 2:49 PM
    • Loading...
    • arshadtop
    • Joined on 01-22-2007, 5:02 PM
    • India
    • Posts 285

    Curt_C:

    I doubt that Sever.Mappath("Mydatabase.mdb") is returning the right path for you...

    Where is your db?

    1) put it in the App_Data folder.
    2) try Sever.Mappath("~/") & "App_Data/Mydatabase.mdb"

     

    Thanks for reply.

    My database is in the root directory, so its working fine on my system but when i upload on my website, its not storing.

    Before i keep my database in "App_Data/Mydatabase.mdb" but i was getting connection problem so i decided to keep in root directory. May be my connection string was wrong. I used before       Server.Mappath("~/App_Data/Mydatabase.mdb")

     

    Thanks.

     

    Regards

    Arshad

    Please Mark as Answer if the post is helpful to you.
  • Re: Database is not storing data

    05-16-2008, 2:54 PM
    • Loading...
    • Curt_C
    • Joined on 07-23-2003, 4:27 PM
    • Stevens Point, WI - USA
    • Posts 4,285
    • Moderator

    ok, so I'm not sure if you are ok or not then?

    Also, please check permissions... with an MDB you need to open up the FOLDER and the FILE permissions to the user context that calls it (typically ASPNET on the server) this is tricky and not always very secure.....

    Curt Christianson
  • Re: Database is not storing data

    05-16-2008, 3:07 PM
    • Loading...
    • arshadtop
    • Joined on 01-22-2007, 5:02 PM
    • India
    • Posts 285

    I check the properties on the web server of .MDB file.

    I found the following one.

    Permission : 666

    Owner                                          Group                       Public

    ---------------------------------------------------------------------------------------------------

    Read (Selected)                          (Selected)                (Selected)

    Write (Selected)                          (Selected)                (Selected)

    Execute(Not Selected)                (Not Selected)                 (Not Selected)

     

    thanks.

     

    Please Mark as Answer if the post is helpful to you.
  • Re: Database is not storing data

    05-16-2008, 5:42 PM
    • Loading...
    • jchandra
    • Joined on 05-15-2008, 5:36 AM
    • Jakarta, Indonesia
    • Posts 197

     Is that for the .mdb file only or the directory holding the .mdb file?  I believe Access will create a temporary lock file on the directory also, but it's been a while since I use one (back in ASP classic days), so only giving read write access to the .mdb file itself might not be enough.  it will need to be able to create new file on the directory.  For that reason it might be best to move Access to its own folder and only allow that folder read write access.

    Jimmy Chandra
    Blogging at Incoherent Rambling

    Mark this post as Answer if you think it helped you solve the problem.

  • Re: Database is not storing data

    05-16-2008, 11:28 PM
    • Loading...
    • geetasks
    • Joined on 03-12-2008, 6:24 AM
    • Posts 125
    Check whether using this connection string can you access data. If Yes, then there is no problem with your connection string.
  • Re: Database is not storing data

    05-17-2008, 1:26 AM
    • Loading...
    • arshadtop
    • Joined on 01-22-2007, 5:02 PM
    • India
    • Posts 285

    geetasks:
    Check whether using this connection string can you access data. If Yes, then there is no problem with your connection string.

     

    I stored some data inside the .mdb file. Yes i can able to retrieve the data from the database. I already check this one.

    Thanks.

    Regards

    Arshad

    Please Mark as Answer if the post is helpful to you.
  • Re: Database is not storing data

    05-17-2008, 1:28 AM
    • Loading...
    • arshadtop
    • Joined on 01-22-2007, 5:02 PM
    • India
    • Posts 285

    jchandra:
    Is that for the .mdb file only or the directory holding the .mdb file? 

     

    I didn't keep my .mdb file in a directory.  Its only .mdb file.

    Thanks.

    Regards

    Arshad 

     

     

    Please Mark as Answer if the post is helpful to you.
  • Re: Database is not storing data

    05-17-2008, 2:45 AM

     check out the tutorial to connect / select / insert / update with Access DataBase > Connecting to a Microsoft Access database with ASP.NET

     

    hope it helps./. 

    Thanx,
    [KaushaL] || BloG || Profile

  • Re: Database is not storing data

    05-17-2008, 4:28 AM
    • Loading...
    • arshadtop
    • Joined on 01-22-2007, 5:02 PM
    • India
    • Posts 285

    Hi Kaushal,

    Really i appreciate you for the information that you have provided for me. I hope this will solve my problem.

    I read the article and i think this is the solution of my problem. Could you clarify my doubt. Look at the following URL :

    http://www.aspfree.com/c/a/Microsoft-Access/Connecting-to-a-Microsoft-Access-database-with-ASPNET/2/

    I found some statement:

    <identity impersonate="true"
     userName="computername\administrator" password="password" />

    Replace the “computername” with your system name and “password” with the password of the “administrator” account.  You can also replace “administrator” with any other customized user account with respective privileges.  I simply demonstrated this using the “administrator” user account.

     

    If i change the above one "Web.config". Hope this will work on my system but what about on my website.Could you tell  what will be the computername when i upload this database on my website. Do you mean my domain name here and ftp password here.

    Thanks.

    Regards

    Arshad 

     

    Please Mark as Answer if the post is helpful to you.
  • Re: Database is not storing data

    05-18-2008, 2:17 PM
    • Loading...
    • arshadtop
    • Joined on 01-22-2007, 5:02 PM
    • India
    • Posts 285

    Hi,

    I get an exception specifying "Operation must use an updateable query".

    I read lot of articles and implemented based on this error but nothing works. Still i remains showing this exception.

    Connecting to SQL Server is very easy but for .mdb file, its very hard.

    I check in my system everything works fine, inserting, deleting and modifying data. But when i upload on the webserver and trying to save the data, i found the above exception.

    I see that all the properties of the .mdb file, it contains read,write and execute mode.

    Do anybody has some solution to this problem.

    Thanks.

    Best Regards

    Arshad

     

    Please Mark as Answer if the post is helpful to you.
  • Re: Database is not storing data

    05-18-2008, 2:37 PM
    • Loading...
    • arshadtop
    • Joined on 01-22-2007, 5:02 PM
    • India
    • Posts 285

    Hi,

    Do you think keeping the database in the root directory of website will also cause this problem.

    Thanks.

    Regards

    Arshad

     

    Please Mark as Answer if the post is helpful to you.
  • Re: Database is not storing data

    05-18-2008, 8:47 PM
    • Loading...
    • bobmmp
    • Joined on 09-06-2004, 6:56 PM
    • Colorado
    • Posts 224

    Putting the db in your root directory is not a safe practic at all.  You need to make sure that you restrict downloading of that file type.

    I had an issue a couple of years ago with my access db not writing but everything else was working fine.  It turned out that I was trying to add the index number (an autonumber field). The app did not produce an error, and it took me for ever to figure out.  Access does it automaticly it seemed my quiry in VB was adding the autonumber with out me telling it.

  • Re: Database is not storing data

    05-19-2008, 1:15 AM
    • Loading...
    • arshadtop
    • Joined on 01-22-2007, 5:02 PM
    • India
    • Posts 285

    bobmmp:
    add the index number (an autonumber field). 

     

    Yes I already added ID autonumber in the table.

    Thanks

    Regards

    Arshad

     

    Please Mark as Answer if the post is helpful to you.
Page 1 of 3 (32 items) 1 2 3 Next >