Sunday, March 11, 2012

Database Diagrams - SQL Server 2005 Express

I have installed Visual Basic 2005 Express and SQL server 2005 Express.

I am reading the ebook: "Microsoft Visual Basic 2005 Express Edition - Build a Program Now" that you download when you register the products (it is a PDF file named 6-2213-2.pdf)

Page 139 of the book (or 151 in the file) is about "To Create Relationships between Tables". So I follow the instruction and get stuck on Step 1. When I right click on the Database Diagrams folder under CarTracker.mdf database and choose Add New Diagram I get the following message:
Microsoft Visual Basic 2005 Express Edition

This database does not have a valid dbo user or you do not have permissions to impersonate the dbo user, so database diagramming is not available. Do you want to make yourself the dbo of this database in order to use database diagramming?

Yes No Help
So I click Yes and get the following error


Microsoft Visual Basic 2005 Express Edition

This database does not have a valid dbo user or you do not have permissions to impersonate the dbo user, so database diagramming is not available. Ensure the dbo account is valid and ensure you have impersonate permission on the dbo account.

OK Help
I am logged in with an account that is a Domain Admin whilst the laptop is not connected to the network. However, I believe this account is like a Local Administraor (from my NT4 days). In other words, I believe it has all the permissions etc. - I don't know what dbo is. I assume it is Database Owner and if it is, well I created the database.

Any guidance would be greatly appreciated ...

Having the same problem here (WXP SP2, Visual SQL Server Express and Visual C# Express). Anyone care to help us out?

Kind regards,

Maurits

Edited to add:

I too am working on a laptop. I'm at home, so I'm not connected to the university network domain but the user account I'm logged in with is indeed an administrator

|||

Here is one more. Just installed Visual Basic 2005 Express Edition on a XP SP2 laptop. Trying to do exercise on page 139 in the "Build a Program Now" book, about creating relationsship between tables.

"This database does not have a valid dbo user or you do not have permissions to impersonate the dbo user, so database diagramming is not avaliable. Do you want to make yourself the dbo of this database in order to use database diagraming?"

I then hit the <Yes> button

"This database does not have a valid dbo user or you do not have permissions to impersonate the dbo user, so database diagramming is not avaliable. Ensure the dbo account is valid and ensure you have impersonate permission on the dbo account."

<OK>

I'm now back to the start again. Shall I create a dbo user account or what?

|||

Here is one more. Just installed Visual Basic 2005 Express Edition on a XP SP2 laptop.

I have the same problem

BR

Alan

|||I had the same problem. My laptop is joined to a domain, and I was working offline. As soon as I connected back to my domain with VPN it starter working again.|||

Brian

Well done. I checked it now that I'm connected to a network domain and I no longer get the error. The diagrams seem to work fine.

Thank you

John

|||

I am also in a domain, but I am connected and still have the problem.

Does this have anything to do with the service account being used? Where can I change the dbo account with SQLExpress?

|||

Regarding service accounts, looking at the service SQL Server (SQLEXPRESS), the Log On tab has:

This account: NT AUTHORITY\NetworkService

[which I never setup or assigned passwords to.]

And looking at the service SQL Server VSS Writer, the Log On tab has:

Local System Account

Please check you have the same settings.

Sorry, I'm not sure if or where you can change dbo account for SQL Express.

|||

I have those same accounts.

I guess the bottom line is...How can I get my account to have impersonate permissions on the dbo account?

Tony Ansley

|||I recently experienced this same problem with the database not having a valid dbo user and being unable to add Database diagrams.

I came to this thread via google and found it to be actually little help since my computer is a stand-alone computer not even connected to the Internet. I am using it for developing the next 'killer app' :)

Anyway - A database connection worked for a while, then it stopped working.

After much fiddling and attempting to recall what I might have broken in the mean time, I realized that between the time that I installed SQL Server Express 2005 and now, I had changed the name of the computer!

I attempted to go into the SQL Server Configuration Tool but couldn't access the server name. Anyway - when I changed the computer name back to the name it had when I did the installation, Everything worked as before - I was able to connect to the databases, create diagrams, and everything!

I hope this helps some of the others of you that are experiencing difficulties.

JosBoy|||

Hi,

I want to give you a little point, to help.

If you create a new Database.mdf you see in the properties one point called "owner". In my case the "owner" was "SHAKIRA\Administrator".

My Computername was HNPC1 and I was logged in (Windows, If you boot your Computer) with this name ("HNPC1\Administrator").

I changed the Computername to SHAKIRA and logged in with this (SHAKIRA\Administrator), and now it was possible to create Diagramms.

God luck

|||I am having the same problem but the solutions posted don't seem to help. Are there step-by-step instructions available|||

The problem is to set up the proper database owner. You should:

-download the free tool from Microsoft site: SQL Server Management Studio Express CTP and install it.

-close the connection to the database (I`m using C# Express Edition, using VB.Net is probably quite the same doing that)

-open the new installed SQL tool

-under "Object Explorer" right click on Databases-"attach"

-find the *.mdf-file and add it

-right click on the new attached database, Properties, "Files", be sure to chose your account as the database owner

-connect to the database using C# Express or what ever

-chose the windows security

that is it.

|||

Thanx AndyWawa,

It pays to go read all the thread before attempting to fix a pro. Your solution was the only one that worked for me

|||

OK, I did that, no change, now what?

My path to this problem was through learning asp.net using the Sussman-Homer book from Wrox. I followed the book through building the db and adding database diagrams and everything worked just fine. Now, trying to teach a little asp in an advanced VB class, it fails (most embarassing for a teacher). The only difference between then and now is adding AJAX. My students (no AJAX) can add database diagrams to their copies.

I downloaded sql server management, installed it, and ran it on my laptop iaw the instructions above only to have the "You do not have permission to impersonate..." messagebox show up as has become maddeningly usual.

Next?

No comments:

Post a Comment