DB2 connectivity from Excel - excel

I need to connect to DB2 from Excel using VBA.
Is there any driver i need to install for this.I am very new to this.So please do help.
PFB the connection string i used
DBCONSRT ="Provider=DB2OLEDB;Datasource=hfdvdb2.intra.testdb.com:40001/TESTQA;Hostname=hfdvdb2.intra.testdb.com;Protocol=TCPIP;Port=40001;Uid=testusr;Pwd=testpwd;
Set DBCON = CreateObject("ADODB.Recordset")
DBCON.ConnectionString = DBCONSRT
DBCON.Open
Is this the correct way to give the connection string.

You'll need to install the DB2 OLEDB Provider for DB2. See this link.
http://www.microsoft.com/en-gb/download/details.aspx?id=29100
For example connection strings, the download itself should have documentation. However, a great site for connection strings is http://www.connectionstrings.com/ibm-db2/.

Microsoft has been creating their own OLEDB providers for DB2 (the IBM's downloads are multi-hundred megabytes and behind paywalls).
The drivers are known as Microsoft OLEDB Provider for DB2, and have been released along with the various SQL Server "Feature Packs".
Microsoft OLEDB Provider for DB2 Version 5.0 HotFix - December 15 2015
Release announcement
x64 Package (488932_ENU_x64_zip.exe)
x86 Package (488931_ENU_i386_zip.exe)
Microsoft OLEDB Provider for DB2 Version 5.0 - January 28 2015
Available with the SQL Server 2014 Feature Pack
x64 Package (DB2OLEDBV5_x64.msi)
x86 Package (DB2OLEDBV5_x64.msi)
Microsoft OLEDB Provider for DB2 Version 4.0 Refresh - December 31 2012
Release announcement (archive)
Available with the SQL Server 2012 SP1 Feature Pack
x64 Package (DB2OLEDBV4_x64.msi)
x86 Package (DB2OLEDBV4_x64.msi)
Microsoft OLEDB Provider for DB2 Version 3.0 - June 11 2010
Release announcement (archive)
Available with the SQL Server 2008 R2 Feature Pack
Package (DB2OLEDB.exe)
Microsoft OLEDB Provider for DB2 Version 2.0 - September 3 2008
Release announcement (archive)
Available with the SQL Server 2008 Feature Pack
Package (DB2OLEDB.exe)
Microsoft OLEDB Provider for DB2 - Version 5.0 Hotfix
Here's a the KB for the latest (as of 3/15/2017 1:11pm) version of the OLEDB provider.
An update for the Microsoft OLE DB Provider for DB2 v5 is now available
Summary
A refreshed version of the Microsoft OLE DB Provider for DB2 v5 is now
available. This update contains all fixes that are implemented for the
Data Integration feature of Cumulative Update 3 for Microsoft Host
Integration Server 2013.
Important note about the updated package
This update requires removing the earlier version of the Microsoft OLE
DB Provider for DB2 v5.
More Information
This update contains the following fixes for Host Integration Server
2013:
All the fixes that were included in Cumulative update package 3 for Host Integration Server 2013
All the fixes that were included in Cumulative update package 2 for Host Integration Server 2013
All the fixes that were included in Cumulative update package 1 for Host Integration Server 2013
All previously released hotfixes for Host Integration Server 2013
Hotfix information
A supported hotfix is available from Microsoft Support. However, this
hotfix is intended to correct only the problem that is described in
this article. Apply this hotfix only to systems that are experiencing
the problem described in this article. This hotfix might receive
additional testing. Therefore, if you are not severely affected by
this problem, we recommend that you wait for the next software update
that contains this hotfix.
If the hotfix is available for download, there is a "Hotfix download
available" section at the top of this Knowledge Base article. If this
section does not appear, contact Microsoft Customer Service and
Support to obtain the hotfix.
Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The
usual support costs will apply to additional support questions and
issues that do not qualify for this specific hotfix. For a complete
list of Microsoft Customer Service and Support telephone numbers or to
create a separate service request, go to the following Microsoft
website:
http://support.microsoft.com/contactus/?ws=support
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it
is because a hotfix is not available for that language.
Prerequisites
To apply this hotfix, you must first uninstall the existing
installation of Microsoft OLE DB Provider for DB2 v5. Then, use the
.msi file that is listed in the "File information" section to install
this hotfix.
Restart information
You may have to restart the computer after you apply this hotfix
Replacement information
This hotfix does not replace any previously released hotfix.
File information
The English version of this hotfix has the file attributes (or later
file attributes) that are listed in the following table. The dates and
times for these files are listed in Coordinated Universal Time (UTC).
When you view the file information, it is converted to local time. To
find the difference between UTC and local time, use the Time Zone
tab in the Date and Time item in Control Panel.
| File name | File version | File size | Date | Time | Platform |
|-------------------------|----------------|-----------|-------------|-------|----------------|
| [Db2oledbv5_x64.msi][7] | Not applicable | 4,210,176 | 13-Oct-2015 | 22:09 | Not applicable |
| [Db2oledbv5_x86.msi][8] | Not applicable | 3,083,776 | 13-Oct-2015 | 22:09 | Not applicable |
References
Learn about the terminology that Microsoft uses to describe
software updates.
Properties
Article ID: 3104962 - Last Review: Dec 15, 2015 - Revision: 1
Applies to Microsoft Host Integration Server 2013
KB Article Number(s): 3104962
- Language: English
- Platform: i386
- Location: 488931_ENU_i386_zip.exe
KB Article Number(s): 3104962
- Language: English
- Platform: x64
- Location: 488932_ENU_x64_zip.exe

Related

Provider cannot be found ADODB error while connecting to Excel 2016 or CSV from Internet Explorer

Background: In our organization, there is a html tool which runs in the Browser(IE11). The tool has a couple of stages and data from each stage is stored in a SharePoint list. In the final stage, all this data needs to be reconciled from a data set which comes from banks in a spreadsheet. Here the tool uses ADODB connection to connect to the Excel file, read the data from it and match with the data on SharePoint.
Problem: Recently after a windows 10 upgrade, the tool stopped exactly on the connection line throwing an error - "Provider cannot be found. It may not be installed correctly". I also got the Microsoft access Database engine re-installed from IT but to no good(this was after reading about answers to my query online)
I am the developer of this tool and it works just fine on my laptop. Below are the specifications of the connection string and other details of software installed
Windows Version: 1511(OS Build 10586. 1176) Windows 10 64 bit
IE: 11
IE version: 11.1176.10586.0
IE Update Version: KB4040685
Office: 2016
Connecting to Excel(version) - 2007-2010 (xls, xlsx format)
Connection Object: ADODB.Connection (via ActiveXObject in JavaScript )
Connection String Parameters
•Provider - Microsoft.ACE.OLEDB.12
•Extended Properties - Excel 8.0 (Also tried Excel 12.0 xml)
•HDR - Yes
•IMEX = 1
OLEDB Drivers installed on the machine: Microsoft ACE 12.0, 16.0 and Jet 4.0
This is the exact same configuration on my laptop and the tool is easily able to connect to Excel or Access also for that purpose.
I have also tried the below, nothing was a success
1.Used Jet.4.0 in the connection string - Here I got error "External table is not in the expected format" & "Unexpected error from database"
2.Tried using ODBC drivers with error - "Data source name not found and no drivers installed"
3.Opened the tool in 32 bit environment
4.Made a HTA app and ran that in 32 bit mode
I also found that in my laptop in the Microsoft Shared folder within program files, there exist Office 14 & 15 folders, but they don't exist in the newer laptops and the same in 32 bit folder of Program files(x86). Would it be possible that having those folders is making the difference?
Please help.
I have learned that installing Microsoft Access Database Engine 2010 (or 2007) on end-user machines fixes the issue, as adodb.dll file is required to be registered on computers using that provider.

Connecting Excel 2016 to Postgres

I am trying to have Postgres show as one of the data connection in Excel 2016. Following MS Office instructions I installed Ngpsql data provider. I used msi for installation so according to the instructions provided in the wizard the dlls were registered in GAC and the provider was registered in machine.config (I checked - the entry is there).
Yet Postgres is still not showing as an option in Excel > Data > New Query > From Database list.
Searching the web shows old out of date discussions. Developers of of Ngpsql direct questions to Stack Overflow. So please help.
Postgres data can be used in Excel 2016 but it requires the ODBC driver and an external setup of the database server. As far as I can tell the Npgsql drivers do not work with my version of Excel which is 2016 MSO 32-bit a.k.a "Home Premium".
The Postgres ODBC driver is available here: https://www.postgresql.org/ftp/odbc/versions/msi/ Download and install the latest version. It should install without needing a system reboot.
Setup a DSN (I used machine) using the ODBC Data Sources (XX-bit) setup application. The driver version needs to match your Excel version.
After testing the connection in the setup screen, open Excel 2016 and use the Data -> New Query -> From Other Sources -> From ODBC menu to open the query screens. This seems to be the most modern interface available in Excel.

Unable to import SQL Azure V12 BACPAC: "type Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider is not valid"

I am trying to import the exported BACPAC from an SQL Azure (v12) database into a local SQL Server 2012 instance, but I keep getting the error below. I have tried installing the DAC and SSDT updates linked from this blog post, but it's not helping.
How can I fix this?
TITLE: Microsoft SQL Server Management Studio
------------------------------
Count not load schema model from package. (Microsoft.SqlServer.Dac)
------------------------------
ADDITIONAL INFORMATION:
Internal Error. The database platform service with type Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider is not valid. You must make sure the service is loaded, or you must provide the full type name of a valid database platform service. (Microsoft.Data.Tools.Schema.Sql)
------------------------------
BUTTONS:
OK
------------------------------
Updated: The new SQL Server Management Studio Preview is the best way to Import to Azure SQL DB. It has support for all the latest Azure SQL DB features and validations. In addition it has a standalone web installer that is automatically updated each month as new features become available. Given comments below mentioning the difficulty of installing a CU update, this would be a simpler & quicker solution to the problem.
Original Answer:
If you are using SQL Server Management Studio to perform the Import, you must have SSMS 2014 CU5 or CU6 installed. Information on installing CU6 is available here. The error shown in your question indicates you're using an older version of SSMS.
**Update: **
In response to Martin's answer below, I'd like to clarify 2 things.
SSMS for SQL Server 2014 is the only version of SSMS with full support of the new Azure SQL DB v12 features, notably Import/Export against this target. This is because v12 has (almost) feature parity with SQL Server 2014 and older versions of the tooling do not have support for this. Note that SSMS 2014 is fully backwards compatible with SQL Server 2005 and up.
There was a separate, temporary issue that caused problems with databases upgraded Azure SQL DB v12. This has been resolved and the correct place to find information about solving this are in section C3 of the Plan and Prepare to Upgrade page. In summary if you've exported a bacpac that is failing to import due to this issue you can download the latest DacFramework.msi from here to fix this issue in SSMS.
Full disclosure: I work on the SQL Server tools team.
To fix import error with [sys].[script_deployment_databases] from exported V12 Database you have to install:
CU13
Microsoft SQL Server Data-Tier Application Framework (February 2015) (you must install BOTH the x64 and x86 versions).
EDIT: CU13 is not necessary, just try second link first!
Install the following and it will work!
1) Have you installed Cumulative Update 5 for SQL Server Management Studio 2014. http://support2.microsoft.com/kb/3011055
2) Microsoft SQL Server Data-Tier Application Framework (February 2015) (you must install BOTH the x64 and x86 versions). http://www.microsoft.com/en-us/download/details.aspx?id=45886
I had the same problem with my dataabse backup from SQL Azure (v12).
I've installed Microsoft® SQL Server® Data-Tier Application Framework (February 2015) (in order to work correctly you will need install BOTH the x64 and x86 versions).
First I've installed x64 version and tried to restore the DB - but it didn't work. After that I've installed x86 version and I could successfully restore the database.
My SQL Server version: Microsoft SQL Server 2014 - 12.0.2269.0 (X64). OS: Windows 10 x64 build 10240.
Tnanks.
BacPac restore from Azure DB fails after installing latest SQL Server Management Studio 2016 Preview. Solution was to set "Contained Database Authentication" = 1 for my local SQL DB instance. Read about solution here or run this script on your local instance:
USE master
GO
RECONFIGURE
GO
sp_configure 'CONTAINED DATABASE AUTHENTICATION', 1
I was using wrong SqlPackage.exe path.
Does not work:
C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe
Works:
C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin\SqlPackage.exe
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\SqlPackage.exe
I'm having the same issue.
Installing Cumulative update package 6 as suggested here helps to avoid the first bug but just to get stuck in the next one.
Related to this topic:
SQL Azure import of bacpac does not work after upgrade to v12
it's a bug Microsoft has no fix or workaround yet.
Edit: SQL Management Studio 2014 is required to restore (2012 doesn't work)
If there's one, I think the thread will be updated.
Edit: In the above mentioned link you now can find a workaround: You need to create a copy of your V12 database. This copy can be exported and reimported on your local sql server 2014.
Just updating the tools doesn't help.
I'm using version 11.0.2100.60 and had the same issue. Installed Microsoft® SQL Server® Data-Tier Application Framework (February 2015). All worked fine after that.

InRelease- Release Management Licence issue using with TFS2012

We installed the latest version of Release Management from MSDN and connected it to our TFS 2012 Server. The migration to TFS 2013 is scheduled to a later point.
After one week we are getting the following error in the logs:
License for Release Management Server for Team Foundation Server 2013 has expired.
Is a TFS 2013 server mandatory for the usage of the new Version of Release Management? In our case it was working for a week without any problems with the TFS 2012.
I didn't see any pages in the Client where a licence can be entered.
We stuck with our Deployment. Help would be much appreciated. Thanks!!
Posted same question at below link also.
http://social.msdn.microsoft.com/Forums/vstudio/en-US/24655842-37a6-4be5-9edb-e31cc0dc74fd/release-manager-2013-preview-inrelease-connecting-to-tfs-2012?forum=tfsbuild
Licensing is on a per-deployment server/CPU core basis. Microsoft has licensing info up on MSDN, but it's still a little bit confusing at the moment.
I suspect that you downloaded a trial version that has expired. If you have an Ultimate MSDN subscription, then you have a free license, per the licensing page.
Release Management works with TFS2010, 2012, and 2013 -- the licensing is the same for all of them, so it's not that you're connecting it to TFS 2012.

How to get older CE 6.0 updates

I'm working on a project with CE 6.0 and I need to rebuild the tree. My problem is that I have to update the tree up to May 2009, this requires the 2008 rollup and the following 5 monthly updates, but I can't find them (there's the 2009 rollup and the following 2010 monthly updates).
I can't upgrade to a newer release as our platform is incompatible with R3 and post-May 2009 updates.
Of course if it would be possible to upgrade the platform so that it would be compatible with R3, I would upgrade, but it is currently not possible for two reasons:
There's a third party middleware that's not compatible with R3.
The product that has already been deployed (hundreds of thousands of devices) has currently an image based on CE 6.0 R2 upgraded to May 2009, an I want to recreate that environment.
Is there a place where I can download the "archived" updates?
The Mobile & Embedded Communications Extranet (ECE) is where the embedded channel resources are archived, but it is an authenticated access site. Credentials are usually obtained through the distributor that the embedded product development tools and licenses are obtained from (distributors like Arrow).
The embedded team blog could be a place to begin looking for contact information for folk within Microsoft.
Once you get access, Embedded > Products > Download Center > Windows Embedded > Windows CE contains:
Windows Embedded CE 6.0 R2 Release - Product Download
Applicable to: Embedded Distributors and OEMs Who Purchase Through Distribution
The Microsoft® Update Windows® Embedded CE 6.0 R2 software is now available for download on the ECE. Windows Embedded CE 6.0 R2 provides the latest breakthrough technologies that enable Windows® Embedded CE 6.0 device makers to quickly and easily build small footprint devices that connect to Windows Vista® and Windows® Server 2008.
...
Posted: November 13, 2007
Windows Embedded CE 6.0 Updates contains:
Product Updates for Microsoft® Windows® Embedded CE 6.0.
For individual updates prior to January 2009 please contact your MS Authorized Distributor.

Resources