How to connect to Microsoft SQL Server on a local VM? - sql-server

I have a Windows 10 VM with SQL Server installed on it. I made sure, that in the Sql Server Configuration Manager the SQL Server Browser is running and the TCP/IP protocol is enabled.
I'm trying to connect to the server with Entity Framework (although I'm not sure if it's relevant) and I'm getting this error:
Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started.
That's the connection string that I'm using:
Integrated Security=SSPI; Persist Security Info=False; Initial Catalog=<database name>; Data Source=<server name>

Related

SQL Server Exception

My requirement is simple: I have an appserver - WAS 6.1 connecting to Microsoft SQL Server 2008 R2.
I have configured data source for the SQL server using the installation scripts in linux.
When I deployed EAR and try to hit application url, I get the below error while connecting to SQL Server.
com.ibm.websphere.ce.cm.StaleConnectionException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: SQL Server did not return a response. The connection has been closed..CWWRA0010E: SQL State = 08S01, Error Code = 0
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
The setup is working for another server configuration.
After a long wait, the issue got resolved. There is nothing to do with the EAR. The SSL encryption was enabled in SQL server settings. Just disable the settings did let me establish connection from application to the SQL server.

sharepoint sql server connection in Windows Azure does not work

I am stuck with a connection from a MS SharePoint Server 2013 to an MS SQL Server 2012 in Windows Azure. I built three VMs: An ADDC, An MSSQL Server and the SharePoint Server. All of them are in the same subnet.
When I am trying connect the SQL Server during the SharePoint setup I am getting following error:
Cannot connect to database master at SQL server at xxx.cloudapp.net. The database might not exist, or the current user does not have permission to connect to it.
The firewall on the SQL Server is deactivated (for testing), The Domain User is listed in database/security/logins and all rights are granted. Perhaps I am missing something.
Connectionstring:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDB;Data Source=MyDB.cloudapp.net

Connect to local SQL Server Express 2008 instance from classic ASP, using SQLOLEDB

I am trying to set up a development testing server, Windows 2008 Server with IIS and SQL Server 2008 Express. The IIS and classic ASP (yeah, supporting antique projects) works fine, including connecting to remote SQL Server 2008 servers, via SQLOLEDB.
However, I fail to connect to the local SQL Server 2008 Express instance. It is installed as an instance (ie, PC-NAME\SQLEXPRESS), and user/pwd authorisation is enabled. I can successfully set up an ODBC entry, so the server works fine. The problem lies in getting the IIS-ASP-SQLOLEDB see the server and connect to it.
Simple connection string, which works on any remote SQL Server 2008 servers, fails at my local express server:
Provider=SQLOLEDB;Data Source=.\SQLEXPRESS;User ID=userName;Password=_pwd_;Database=DbName
The error I get is
SQL Server does not exist or access denied.
The server error log does not contain any trace of unsuccessful login attempt, so I assume there is some problem resolving the data source (because of the instance name?), or the server is somehow inaccessible (protocol, security settings?) from the IIS process.
In SQL Server 2008 express edition it runs on dynamic ports. The solution is just go to properties of the TCP/IP and in the TCP Port just give whatever port you want your SQL Server to listen on.
strConn = "Provider=SQLOLEDB; Network Library=DBMSSOCN; Data Source=.\SQLEXPRESS; Connection Timeout=15;Packet Size=4096; Initial Catalog=DbName; User ID=userName; Password=_pwd_;"
Can you post how you access the connection object via ASP?

Classic ASP, problem logging in to SQL Server using Windows Authentication

I failed to connect using this connection string
strConnString = "Provider=SQLOLEDB;Initial Catalog=fsw;SERVER=HARDIXP\hardi;Integrated Security=SSPI;"
Microsoft OLE DB Provider for ODBC
Drivers (0x80004005) [Microsoft][ODBC
SQL Server Driver][DBMSLPCN]SQL Server
does not exist or access denied.
I can connect fine using SQL Server Management Studio. On the "Connect to Server" dialog, I have
Server Name: HARDIXP
Authentication: Windows Authentication
After it is connected, the server looks like this
HARDIXP (SQL Server 10.0.2531 - HARDIXP\hardi)
If I don't specify the server name, the error will be
Microsoft OLE DB Provider for SQL
Server (0x80040E4D) Login failed for
user 'HARDIXP\IUSR_GEOFFREYXP'.
Note that it is trying a different user, probably because the database was first set up for Geoffrey, not Hardi.
How can I connect to my local SQL Server from this Classic ASP code?
EDIT: I am on Windows XP, IIS 5.1
Assuming this is running on windows.
The ASP process needs to be running as a windows authenticated user that has access to the
database. Just set the application pool on the website to have this identity's credentials.

SQL Server 2008 SSMS connection and http connection string?

I have a SQL Server 2008 on a server which goes out on the internet through a domain name computer.example.com, I want to develop a .net app on my PC and to connect to that database through SSMS - to create tables and so on...
And I still want a connection string which can be accessed from anywhere - I'm thinking at a http url or something like that - which will be consumed by the app.
What do I must to configure on the server so that I can connect via SSMS to the database (from my PC) and how do I get a connection string to that database?
you can use Sql Server Configuration Manager for this work. when you run this application, expand the SQL Server Network Configuration, after that you can see Protocols for sql server 2008. by click on it you can enable or disable TCP/IP.
your connection string can be like this :
connectionString="Database=DBName;Server = Server IP;Integrated Security=false;user id=sa; password=Pass;

Resources