Options

SQL Issue

billybob01billybob01 Member Posts: 504
Hi, i have a problem at work whereby my manager thinking he would do some housekeeping on a server has deleted the SQL data on one of our servers, and so he has come to me paniking, so i have re-installed SQL 2000 ( it`s an old server) and restored the data from a backup. I then browse to the internal web page whereby you should be able to click a link to view the addresses of contacts but i receive the error below. Sorry for being vague, but i dont know much of SQL.

Microsoft OLE DB Provider for SQL Server error '80004005'

Login failed for user 'WebUser'. Reason: Not associated with a trusted SQL Server connection.

/ltp/TeleDirUser.asp, line 104

Comments

  • Options
    bertiebbertieb Member Posts: 1,031 ■■■■■■□□□□
    Did you restore the master database too?

    Looks like the asp script you're using is using an ODBC connection to connect to the database. It's complaining that's there's no SQL user called 'webuser' within the SQL account database since you rebuild it.

    If it's only a couple of users, you can recreate them manually again within SQL but bear in mind you may also have to sort out a few 'orphaned users' - which is straight forward enough (PRB: "Troubleshooting Orphaned Users" Topic in Books Online is Incomplete)

    Should be fairly easy to sort this one out, let me know how you get on.
    The trouble with quotes on the internet is that you can never tell if they are genuine - Abraham Lincoln
  • Options
    dtlokeedtlokee Member Posts: 2,378 ■■■■□□□□□□
    It could also be an issue with the authentication mode, if you're using SQL users make sure it's set up for mixed mode.
    The only easy day was yesterday!
  • Options
    billybob01billybob01 Member Posts: 504
    Many thanks for the replies guys, but i dont have any info regarding the history of the install, so i sont have username or password info when installing SQL, and i am lost as to what to do next, but at the same time very interested to find the fix.
  • Options
    bertiebbertieb Member Posts: 1,031 ■■■■■■□□□□
    As dtlokee says, firstly check the authentication mode within SQL. I personally *think* you're using SQL users here so it should be mixed mode (a quick check - do you have a domain user or even a local user called 'webuser' on the system?) but its a good check in the first instance and you can temporarily set it to mixed mode authentication anyway to ensure you have all bases covered.

    Otherwise, I think that asp script will be using a SQL user in the code and an associated ODBC connection. You can usually look at the asp code throwing the error to see if the u/n and password is embedded in one of those scripts and then recreate the sql user within SQL2000 based on that info. Did you have a backup of the master database as well as the 'user' one? If so you can restore that and it'll restore any associated SQL users that were present.

    Looks like you're a bit hampered here by previous documentation (or lack of), as well as your bosses dodgy housekeeping :D Is the guy/gal who wrote the application still knocking around?
    The trouble with quotes on the internet is that you can never tell if they are genuine - Abraham Lincoln
  • Options
    brad-brad- Member Posts: 1,218
    bertieb wrote: »
    Did you restore the master database too?

    This was the first thing that came to my mind too, if you had to reinstall it completely...that means all your database logins are gone. You need to restore the old master database.
  • Options
    billybob01billybob01 Member Posts: 504
    Ok i will look at restoring the master database, but how do i do this, i mean what am i looking for in order to know i am backing up the Master Database??
  • Options
    brad-brad- Member Posts: 1,218
    billybob01 wrote: »
    Ok i will look at restoring the master database, but how do i do this, i mean what am i looking for in order to know i am backing up the Master Database??


    If you use the gui to browse, the master database is one of the 4 system databases, so it should be at the top of the tree. If you have access to the old system, go to Databases--> System Databases and you'll see MASTER among the 3 others. Back it up on the old system, restore it to the new system - the right click menus can help you do this if you dont have it scripted.

    If you dont have a backup of the old system databases (ie master), then you may just be SOL and have to rebuild the logins...idk.
  • Options
    blargoeblargoe Member Posts: 4,174 ■■■■■■■■■□
    Check your SQL Server logs to see if you restored the master db... it would be logged
    IT guy since 12/00

    Recent: 11/2019 - RHCSA (RHEL 7); 2/2019 - Updated VCP to 6.5 (just a few days before VMware discontinued the re-cert policy...)
    Working on: RHCE/Ansible
    Future: Probably continued Red Hat Immersion, Possibly VCAP Design, or maybe a completely different path. Depends on job demands...
Sign In or Register to comment.