SQL Server 6.5

  • Good day people!

    I am an real noobie in SQL Server, i have just bought it here from Sweden, its version 6.5!

    I need some help with it, i get this message all the time when i try to add Text into my column in this database..

    The Error:

    INSERT permission denied on object tblNews, database Test, owner dbo.

    And the code:

    Dim MyString

    MyString = "atrinho"

    Set objCon=Server.CreateObject("ADODB.Connection")

    Set objRs=Server.CreateObject("ADODB.Recordset")

    objCon.Open("Provider=sqloledb;Data Source=hsdf;Initial Catalog=asfd;User Id=asdf;Password=asfd;")

    Variabel = "nadal"

    strSQL="Insert Into tblNews(nTitle) VALUES('"& Variabel &"')"

    objCon.Execute(strSQL)

    Please help me!


    Kindest Regards,

    Atra
    atrinho.tk

  • You need to simply add the login/user 'asdf' to the server/database and grant permissions to the tables.

    I don't know if there are any restrictions and separation of responsibilities (i.e. dba and developer), but you'll need a minimum of db_datawriter role on the db.   If you grant user 'asdf' db_owner, this is the highest level rights on the database.

    Hope that helps!

     

     

    Indeed a faux paus! I blundered. I have alas faded away from the world of 6.5. My apologies.

  • Hi Atra,

      Looking at this error and the code you submitted, I would guess that you have not granted permission for the asdf login in the asfd database.  Further, it would appear that the default database for the asdf user is the Test database.

      SQL 6.5 didn't have the nice role based security built in, so you'll have to do this manually.

      In Enterprise Manager, connect to your server and expand the Logins.  Right click on the asdf login and select Edit.  Make sure that there is a check in the Permit column for the asfd database.  Next expand the databases and then asfd from the treeview.  Then expand Objects and Tables.  Right click on the tblNews table and select Permissions.  Make sure that there is a check in the Insert column for either the user asdf, or for the group that asdf is under, probably Public.

      Once that is done, your code should work.

    Good Luck,

    Steve


    Regards,
    Steve

    Meddle not in the affairs of dragons, for you are crunchy and taste good with ketchup.

  • Damnit sharell, i should kiss you..=D

    Sorry bout' my english its a bit crappy..

    But as said, thanks sharell!

    I will test it when i get home..


    Kindest Regards,

    Atra
    atrinho.tk

  • It works!!!!!!!!!!!!!!!!!!!!!

    Thank you very very very very much Sharell!(k)


    Kindest Regards,

    Atra
    atrinho.tk

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply