sql server express 2008 r2 and VS2012, untrusted domain - sql-server-2008

I have a windows XP Pro in a vritual machine with SQL Server 2008 R2 and other computer in the same LAN and same workgroup with VS2012.
When I try to create a new connection in VS2012, I can see the server name, but when I trey to see the databases, I get an error that I am trying to connect from an untrusted domain.
I would like to know if it is possible to create a domain in windows XP Pro and add my two computers to the same domain.
By the moment, SQL Server are cofingurated only to use windows authentication, but no SQL Server authentication, because I would like to avoid to put user and password in my connection string of my app config file.
thanks.

You need a domain controller to make a domain, so just having XP Pro won't do it I'm afraid.
However, if you have a Windows account with identical usernames & passwords on both machines then it should still "just work". You can't put a Windows username/password in a SQL connection string - you'll need to run your code as that user. That can be done by starting your application using RunAs (shift+right-click on shortcut and choose "Run as...", or use RunAs at the command prompt).
This is pretty brittle but so long as you make sure the passwords are kept in sync then you should be ok.

Related

SQL Server 2014 not accessible from network

I have setup a SQL Server 2014 instance on my local drive/computer and everything is working fine. I can login and access the data inside. I have the role admin on both the SQL server and my local computer. The computer is in an AD of a network. However, if I go to a different computer in the network, (I can ping to and from machine in the network no problem) and attempt to login my SQL server 2014 under the same credentials using Windows Authentication, I got the error below:
I have checked the configuration on my local machine where the SQL server 2014 resides and have all protocol enabled.
I also have SQL Server service set to automatic:
What else do I need to look into to make sure my SQL Server can be accessible from the network? My local computer OS is Windows 8.1.
Please help as the SQL Server is pretty useless if only my local machine can access the data in the SQL Server.

Connecting SQL Server through Network

I have developed an App using Delphi Xe3 and SQL Server 2008. Now the app is finished and compiled. I would like to run the app on another machine that is connected to the main Machine(running SQL Server) via Wifi. However when I run the app on another machine, I get the error " Server does not exist or access denied". I have enabled the SQL server for remote access enabled TCP/IP. Someone told me I would have to be running SQL server client on the other machine to access the server database. what am I missing to be able to run my app on machine B to share the database running on machine A.
I think sql server has remote connections off by default.
Run SQL Server management studio.
Right click on the server.
Properties
Connections
Under "Remote server connections", check on "Allow remote connections to this server"
For a default SQL instance don't add the name of the instance in the connection string Data Source. It somehow works when you test the connection from udl but does not work when you use the instance name in the Delphi app.

How To Secure SQL Server Database On Client Machine?

I Just Completed My Window Application,In Which I Use SQL Server 2008 as Back-End.
I Install My App With Database In Client Machine.
But Problem Is That My Client Can Also See My Database Using Sql Server Mangement Studio.
I Want to Prevent Client To See Database.
How can i do this?
That's the entire purpose of a database server. For any authenticated client to be able to connect to the server. That client may be your application or any other application - Management Studio being one of them.
You can either host your database server anywhere else and set up SQL server to only accept connections from your web application's server. But anyone that knows the IP, instance, and has the proper credentials can connect anyway from that server.
Or you can set up a user on SQL server for your application and configure your application to use that user. Now only the database administrator and that user can access that database.
But anyone that browses your application's configuration files will be able to pull the credentials anyway from there. Unless you are using integrated security, in which case the user your application runs under will be the only one to have access - assuming you grant that Windows user access to the database of course.
I guess the real question is, why are you trying to prevent someone from directly accessing the database?

How do I connect VS2010 to a MySQL database (locallay on another computer)?

I have a MySQL database on another windows computer (a server) that is setup locally using remote desktop connection for testing.
How can I connect to that local database to Visual Studio 2010 on "my computer"?
Server Computer(MySQL database setup local) --> My Computer(Visual Studio for test code..)
I am new to MySQL and any suggestions will help.
Thanks
PS: I have found this, but the "Server Name" for the database is 127.0.0.1 which I can't use because it is local on whatever computer you are on.
http://geekswithblogs.net/mbridge/archive/2010/12/13/visual-studio-2010-hosting--connect-to-mysql-database-from.aspx
You'll have to use the address of the computer that it is hosted on. It should be the same as the address you use to connect to the remote desktop session.
You might need to configure the firewall to accept the connection. You also might need to setup MySQL to allow remote connections with the user that you authenticate with.
I would recommend downloading MySQL workbench and install it on your local computer. Once you get the connection working with that, you should be able to use the connection with VS2010.
If you're not sure how to do the things listed above, you'll need to start out with a basic tutorial on setting up MySQL for remote connectivity.

Only Administrator can login to SQL Server

I'm using Windows Server 2003 to run a server application which utilizes SQL Express 2008. I'm also using Windows Terminal Services to host a bunch of thin clients, so I've had no need for active directory domain server and other stuff like that.
Now I have "small" problem regarding logging in to the SQL Server. Only the Administrator account can do this, even if I give my other (test) user administrator privileges by adding him to the Administrators group.
This is the error received: Cannot attach db file to database [Client 127.0.0.1]
I've already checked that the filepath is accessible by the user in question, and like I said, this works perfectly fine for the administrator user.
What account is the SQL Server itself running under? Often it may be running under a domain service account, and it may not have permission to certain folders. Also, the C: drive has progressively become more locked down in Windows with regard to SQL Server database files.
Seems I found the answer. Using SQL Management Studio i gave the "Users" group sysadmin permission for the database, now everything works as expected.