PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Database is read only-VBForums
Results 1 to 16 of 16

Thread: Database is read only

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    149

    Database is read only

    I'm getting a 500.100 error and it is saying that my database is read only but when I check the properties of my database and its directory it is not set to read only

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: Database is read only

    have you enabled security for the database?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    149

    Re: Database is read only

    Quote Originally Posted by moinkhan
    have you enabled security for the database?
    nope .... I searched on google but I cannot get a fix for this one. Is there any other settings that I can change on my IIS?

  4. #4
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: Database is read only

    Quote Originally Posted by Zelot
    nope .... I searched on google but I cannot get a fix for this one. Is there any other settings that I can change on my IIS?
    zip your database and project and upload it here... :chips i need to have a look on that...

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    149

    Re: Database is read only

    Quote Originally Posted by moinkhan
    zip your database and project and upload it here... :chips i need to have a look on that...
    It's my college project so I'm sure it's working I just want to look at it again ... It works fine I can search through the database, the pages can display the data from the database the only problem is when I try to update the contents on my database it shows the error 500.100 and it tells me that my database is read only but it's not

  6. #6
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: Database is read only

    Quote Originally Posted by Zelot
    It's my college project so I'm sure it's working I just want to look at it again ... It works fine I can search through the database, the pages can display the data from the database the only problem is when I try to update the contents on my database it shows the error 500.100 and it tells me that my database is read only but it's not
    Tell me how are you connecting to your database? give the whole connectionstring here...

    by the way you can also try repair and compact database option .. so if it is due to some database problem, it can be eliminated..

    well... i need to look at the code... dun worry...i wont copy and commercialize ur software

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    149

    Re: Database is read only

    Quote Originally Posted by moinkhan
    Tell me how are you connecting to your database? give the whole connectionstring here...

    by the way you can also try repair and compact database option .. so if it is due to some database problem, it can be eliminated..

    well... i need to look at the code... dun worry...i wont copy and commercialize ur software
    haha ... I'm just a beginner in this web programming thing and I don't think anyone will waste their time copying my code . I just don't want to see anyone posting negative comments about my code

    HTML Code:
    On Error Resume Next
    Set cnnMyCon= Server.CreateObject("ADODB.Connection")
    cnnMyCon.ConnectionTimeOut = 10
    cnnMyCon.CommandTimeOut = 20
    Server.ScriptTimeOut = 60
    cnnMyCon.CursorLocation = adUseClient
    cnnMyCon.Errors.Clear()
    cnnMyCon.Open "dsn=MyDbase;uid=" & Session("LoginName") & ";password=" & Session("Password")& ";"

  8. #8
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: Database is read only

    Well one thing... in ASP you cant use constants like adUseClient etc...

    also write the code where you are getting the recordset.. and where you are trying to update the database..

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    149

    Re: Database is read only

    Quote Originally Posted by moinkhan
    Well one thing... in ASP you cant use constants like adUseClient etc...

    also write the code where you are getting the recordset.. and where you are trying to update the database..
    Ok ... I edited it and it still gives me the same error. I haven't tried fixing the database yet ... I'll post as soon as possible (tnx).

    HTML Code:
    	Set cnnMyCon=Server.CreateObject("ADODB.Connection")
    		cnnMyCon.Provider="Microsoft.Jet.OLEDB.4.0"
    		cnnMyCon.ConnectionString="Data Source=" & server.mappath("Dbase\MyDbase.MDB")
    		cnnMyCon.Open	
    
    	Set rsHeader=Server.CreateObject("ADODB.Recordset")
    		rsHeader.Open "Select * from Headers where HNum=4",cnnMyCon,1,3

  10. #10
    Hyperactive Member
    Join Date
    May 2002
    Location
    Campbell, OH USA
    Posts
    282

    Re: Database is read only

    try something like this
    VB Code:
    1. dim cs
    2. dim strCon
    3. strCon = "Provider=SQLOLEDB;Server=Dserver;User ID=Dadmin;Password=Dpassword;Database=Ddatabase;"
    4. set cs = Server.CreateObject("ADODB.Connection")
    5. cs.connectionstring = strcon
    6. cs.open
    7. dim rs
    8. set rs = Server.CreateObject("ADODB.Recordset")
    9. rs.CursorType = 0
    10. rs.CursorLocation = 2
    11. rs.LockType = 3
    12. dim sql
    13. sql = "select * from Dtable", cs
    14. rs.open sql, cs
    15. 'do your grove thang
    16. rs.close
    17. rs = nothing
    18. cs = nothing
    Which X do you like better???
    Code:
    x     x       \      /
     x   x         \    /
      x x           \  /
       x             ><
      x x           /  \
     x   x         /    \
    x     x       /      \

  11. #11
    Addicted Member
    Join Date
    Nov 2006
    Posts
    132

    Re: Database is read only

    Quote Originally Posted by moinkhan
    Well one thing... in ASP you cant use constants like adUseClient etc...

    also write the code where you are getting the recordset.. and where you are trying to update the database..
    You can use the ADODB constants by using the adovbs.inc file that is easily located by searching the web.

  12. #12
    Addicted Member
    Join Date
    Nov 2006
    Posts
    132

    Re: Database is read only

    Quote Originally Posted by Zelot
    I'm getting a 500.100 error and it is saying that my database is read only but when I check the properties of my database and its directory it is not set to read only
    You probably need to set the security on the folder and/or mdb file so the IIS user has access to your database for writing.

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    149

    Re: Database is read only

    Quote Originally Posted by woodyz
    You probably need to set the security on the folder and/or
    mdb file so the IIS user has access to your database for writing.
    The only setting that I changed was on its properties I set it to read and write both for the database and the directory but it is still giving me the same error ... I'll try reinstalling my IIS and check if that would work. I'll post as soon as possible tnx for the replies

  14. #14
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: Database is read only

    turn off Simple File Sharing .. then on the folder where the DB is located right click properties .. you will see a "Security" tab ..click on the USERS group to highlite it, then check the box FULL CONTROL, ALLOW .. click ok and then try it again .. that enables EVERYONE access to to read and write in that folder .. so essentially it is a security risk if it is a live site .. but thats what works for testing and is needed to read and write toa database.

    Also, make Sure Scripts Virtual Directory is installed under IIS and WWW Service in Add Remove Windows Components.

    PS. you can simply assign constants to the database connection types instead of using the adovbs.inc file ..eg.

    Const adStateOpen = &H00000001
    Const adOpenStatic = 3
    Const adLockReadOnly = 1
    Const adCmdText = &H0001

    Or alternatively, better than using adovbs.inc file would be this include ..
    <!--METADATA
    TYPE="typelib"
    FILE="C:\Program Files\Common Files\System\ADO\msado20.tlb"
    -->
    Last edited by rory; Nov 18th, 2006 at 07:19 AM.

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Oct 2004
    Location
    Philippines
    Posts
    149

    Re: Database is read only

    Quote Originally Posted by rory
    turn off Simple File Sharing .. then on the folder where the DB is located right click properties .. you will see a "Security" tab ..click on the USERS group to highlite it, then check the box FULL CONTROL, ALLOW .. click ok and then try it again .. that enables EVERYONE access to to read and write in that folder .. so essentially it is a security risk if it is a live site .. but thats what works for testing and is needed to read and write toa database.
    -->
    Hey it worked! I almost gave up on this one. Thank you

  16. #16
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: Database is read only

    Cool ...

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width