Differences between ADOMD.net and Analysis Services OLE DB Provider (especially regarding authentication) - oledb

I'm attempting to connect to a SQL Server Analysis Services cube on a remote server which is not connected to the domain I'm connected to.
I can connect to the cube with Excel after providing username and password. Now I'm trying to connect to the same cube via code.
Unsuccessful connection via AdomdConnection
Using ADOMD.net (AdomdConnection) for SQL Server 2008 R2 I try to connect with this connection string:
Data Source=SRV1;Initial Catalog=Name of Cube;User Id=RemoteAccount;Password=***
This connection fails on the Open method of the connection. Interestingly the "user id" and "password" properties are allowed, because if the syntax was wrong you get a KeyNotFoundException.
Successful connection via OleDbConnection
I can successfully connect if I use OleDbConnection instead and the following connection string (copied from the Excel connection):
Provider=MSOLAP.4;Persist Security Info=True;User ID=SRV1;Password=***;Initial Catalog=Name of Cube;Data Source=SRV1;
So my questions are:
Can someone explain this behaviour? I thought AdomdConnection just used OleDB underneath?
Is there a way to connect to a SSAS
instance with AdomdConnection using
username and password?
Are there any
further differences between
AdomdConnection and OleDbConnection?
All downloads are available here.

I'm using the AdomdConnection succesfully with the username / password keys, but the difference is that I'm connecting to a HTTP data source. The solution I'm using is that I tunnel OLAP traffic over HTTP via IIS 7 as described in MSDN. The user name and password are then impersonated by IIS to Windows credentials.
Note: Disable Anonymous and Windows Authentication in IIS. I only got it working with Basic Authentication. For enhanced security, use SSL.

If you cannot connect the cube with excel, then you cannot connect it with the code.
The difference between ADOMD.Net and OleDb connection is that, the OleDb MSOLAP provider can be used to send MDX, DAX and DMX queries to an Analysis Services database. The result can only be a scalar or a table, so you cannot use an MDX query returning results on more than two axes. When you use a DAX query, the result will always fit well in a table, you can use a DataReader class to get the result.
We prefer mainly ADOMD.NET on OleDb due to the presenceConnection bug which hasn't been resolved.
In order to connect to SSAS instance with ADOMD.NET we need to add the following line in web.config file ( After creation of console application in Visual studio 2012)
Since we will be using Windows authentication to connect to Microsoft Analysis Services 2005, this addition of line in the web.config file is required to impersonate a user having access to the Analysis Services.
We need to configure the IIS server by creating a new application pool.
Following MSDN link will give other parameters of the ADOMD.NET connection String.
https://msdn.microsoft.com/en-us/library/microsoft.analysisservices.adomdclient.adomdconnection.connectionstring

Related

Delphi, TAdoConnection, Azure SQL Managed Instance

I'd like to move the database for several Delphi applications from on-premise SQL Server to Azure Managed Instance. It would use Azure Active Directory Integrated authentication.
We use TADOConnections. I'm having trouble setting the connection string. It looks like TADOConnection does not support Azure Managed Instance and Azure Active Directory Integrated authentication. Is that correct?
Version 18.3 and latter of the Microsoft OLE DB Driver for SQL Server includes the required Microsoft Active Directory Authentication Library (ADAL.dll). Since this traffic is going across the internet keeping this up to date would be a good practice.
Then using the connection string shown for the database on Azure as a starting point you can add Provider=MSOLEDBSQL.1 (plus a ; separator if needed) in the ADO connection string so the above driver is used.

How do i connect to database after i installed SSIS 2012?

I am trying to connect to database from Integration Service project from Microsoft visual studio. How do I create a database from SQL SERVER 2012.
SQL Server Management Studio (SSMS) will allow you to create a database and tables through its graphical user interface. However, I'm guessing what you're looking for is actually an SSIS Connection Manager to an existing database. Look at the connection managers in SSIS, create a new one, and fill in the boxes. What you're doing is building a database connection string. You will need credentials (username and password, or a Windows authenticated user) to connect to the database. Also, you may need to spend some time reading the documentation.

FQDN in SQL connection string

We have an azure website and an azure VM
our SQL instance is on the VM.
I am trying to craft a connection string that will allow the azure site to see the SQL box
using the FQDN doesn't seem to work
any help would be greatly appreciated
Thanks
You will have to (not so wide) open a port for the SQL Server on VM. You can do this by setting an Endpoint. The good thing is that an Endpoint has a Public port (this is what Internet sees) and a Private Port (this is where the connection goes on the VM itself). Thus easily masking the default port 1433. My personal advise is that you NEVER open public port 1433 for your Server. Even in that scenario, I would advice you to use ACL on the Endpoint to only allow connections from Azure web sites in the DataCenter your web site is deployed. As stated in the last referred article, you shall not assume that traffic originating from Azure DataCentres is trustworthy, but at least you limit the attack surface for your SQL Server.
You may also evaluate using Hybrid Connections with a VM, but I never tried it.
Another side of the story is that you may want to consider using SQL Azure (sorry, Azure SQL Database) instead of maintaining own SQL Server. Then your connection will be securely established without a lot of hassle.

Trying to connect ASP.NET MVC to SQL Server 2008 R2 with possible wrong connection string

Running SQL Server 2008 R2 and ASP.NET MVC 2 web application on the Virtual Server of big german hosting-provider.
I have a problem to connect to the SQL Server.
On localhost this connection string works fine:
#"Data Source=LOCAL-HP;Initial Catalog=OnlineVertrag;Integrated Security=True";
I'm using a similar connection string on the server:
#"Data Source=MYSERVER\SQLEXPRESS;Initial Catalog=OnlineVertrag;Integrated Security=True";
but nothing happens over there.
Here is my project which I am trying to connect: http://www.hotcont.eu/OnlineVertrag/Home
Based on your comments, your SQL instance on the server has a username/password combination. You cannot use the integrated security connection for a SQL Server connection requiring SQL authentication.
Using the login information provided to you by your host, you should update your connection string to the following:
Server=MYSERVER\SQLEXPRESS;Database=OnlineVertrag;User Id=myUsername;
Password=myPassword;
Taken from ConnectionStrings.com
EDIT
Ok - I think I know what you are dealing with now. You have a virutal machine hosted on a large hosting provider -> meaning that you have control over the machine itself (aka Remote Desktop Management or something?)
The SQL connection string that I provided is for use with SQL server accounts -> meaning those that you actually create within SQL server itself. The SQL connection string that you provided uses the current logged in user's user account information from Windows to connect to SQL.
So here is the disconnection between localhost and the virtual server. When you are running on localhost, I am going to assume that you are using the built in web server to Visual Studio or some equivalent. Most often, during debugging, the web application is running under the Logged in user of the machine - aka: you. You have permission to your own SQL database, thus no issue. BUT...when you deploy your web application to an IIS instance, the web application is no longer running as the logged in user, but rather the identity of the application pool that is your app is a member of. Typically this is something like NETWORKSERVICE.
You have three options available to you
Enable and use SQL user accounts for connection from your web application and your SQL server. If you choose to go this route, you will need to use the connection string I provided above.
Login to your SQL server and add the identity of your application pool to the Allowed Users of SQL server and your database.
Change your application pool's identity to an actual user account on the server (BAD IDEA)
Most web applications go with the first option as it allows you do a few things such as create a distinct SQL user for each application that you host and as well as you can explicitly define permissions for the SQL user to each database that it may need access to (for instance, do not allow the SQL user to DROP tables).
EDIT 2
The way you are trying to connect sounds like it should be using the Shared Memory Protocol, but it might be trying to connect over TCP/IP. I forgot this earlier, but most installs of SQL are not setup to listen on the TCP/IP interface on first install. To check your configuration, click the start button (or orb or whatever Microsoft calls that now) -> All Programs -> Microsoft SQL Server 2008 -> Configuration Tools -> SQL Server Configuration Manager. This will open a new window with some options on the left hand side. Click the SQL Server Network Configuration. Ensure that TCP/IP and Shared Memory is set to enabled. If a 64 bit install, you should probably do this for both the SQL Server Network Configuration (32 bit) and the SQL Server Network Configuration
http://msdn.microsoft.com/en-us/library/ms191294.aspx
Try this
Data Source=MYSERVER\SQLEXPRESS;Initial Catalog=OnlineVertrag;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False
I hope this works for you.

Sharepoint Database Access within a domain

I have two servers in a domain. Web Server & Database Server.
I have a number of standard .net websites accessing the SQL Server with no problems, using SQL Username/password combos for each database.
Sharepoint configures the access as Integrated Security=True
When I ran the Config wizard, I 'briefly' saw the Admin top-site.
After a short browse around, I lost the connection. [I touched/changed nothing!!!!]
I now get "Cannot connect to the configuration database."
It seems obvious that the problem is one of access permissions to the database but I can't see it.
The IIS Website uses the Sharepoint AppPool which in turn uses a Domain Account that successfully created the SharePoint_Config Database and & Content databases. They obviously continue to use that account.
The Event Viewer shows multiple instances of:
"Unable to connect to the database SharePoint_Config on [Database Computer]. Check the database connection information and make sure that the database server is running.."
Any suggestions?
This occurs when:
The SQL database or service is not online/running.
Internet Information Services (IIS) is configured to run in IIS 5.0 isolation mode.
The account that is used by application pool does not have the required permissions to the SQL Server database.
Network connectivity has been lost between the Windows SharePoint Services server and the Microsoft SQL Server server.
Check all of those and if all of that is set, check your sql server. Make sure your config database isnt marked as 'suspect' or that something else isnt off. Try resetting your SQL service.
I've also had this happen when an application pool account was changed. Even if the application pool is online, sometimes recycling it does the trick. Alternatively, confirm the application pool account:
Open Server Manager.
Click on Roles.
Choose Web Server (IIS)
Choole IIS.
Open server in the Connections panel.
Choose Application Pools.
For every item in Application Pools, click on it once, and then choose Advanced Settings.
Under Process Model, Identity,
change it, choose "Custom Account".
Enter an account and password for an account with a lot of permissions. I used the Sysadmin.
Restart the Web Server.
Also, 32 or 64 bit? Make sure IIS is running in the right mode, sometimes additional software installs can change things:
First, fix IIS:
\inetpub\AdminScripts\cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 False
Second, reregister the .Net isapi filters:
\windows\microsoft.net\Framework64\v2.0.50727\aspnet_reg
iis.exe -i
If it is none of the above, have there been any DNS or NETBIOS changes? That is also a common cause.
If nothing else works, simply try to reboot your server.

Resources