connecting to access database using MFC CDatabase in VS2012 and windows 8 x64 - database

To connect a access database by Programming with MFC, using visual studio 2012 update 1 installed on windows 8 x64, the following code throws exception, which did not happened before in vs2010 and windows 7 x64. Is there any thing changed about the ODBC manager and how should I change the connection string.
CDatabase db;
db.OpenEx(TEXT("ODBC;Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dsn='';Dbq='d:\\databases\\a.mdb'");
and the exception message:
'Data source name not found and no default driver specified'
It does not work for accdb file too.

cha in the comments was correct since by default only x64 ODBC driver is present in windows 8 for MFC applications compiling in win32 platform It is necessary to install ODBC driver in x86. It could be downloaded from here: http://www.microsoft.com/en-us/download/details.aspx?id=13255

Related

OLE DB access from Visual Studio 2019 error

I try to access an OLE database in order to use it in a Windows Forms .NET Core Application in Visual Studio 2019 and I obtain the next error:
System.Data.OleDb is not supported on this platform.
As the error says a winforms program targeting .NET 5 , OLE DB 7.0.0 cannot run on that version of .NET .
The solution is: the same program target .Net 6.0 works perfectly in VS2022.

Access Database engine OLEDB in windows server 2016

I have an application that uses Microsoft ACE OLEDB 12.0 driver and hence I have installed 2007 Office System Driver: Data Connectivity Components in my system.
I also have created SSIS packages to pull data from the excel and csv files which get's inserted into the SQL tables using the Microsoft ACE OLEDB 12.0. Below is my connection string
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myOldExcelFile.xls;
Extended Properties="Excel 8.0;HDR=YES";
I wanted to move these applications to the server environment for deployment and When I reached out to the IT for getting Office 2007 system driver to be installed, they said it's not supported in Windows server 2016 and have security vulnerabilities.
Hence I wanted to know whether we have any alternate Microsoft OLEDB provider for SSIS operation? I tried installing office 2010 however I got the error message that
Microsoft OLEDB 12.0 is not registered on my machine.
Will installing Microsoft Access Database Engine 2016 Redistributable help me out in resolving the problem. If yes what will be my connection string. Is the below one correct?
Provider=Microsoft.ACE.OLEDB.16.0;Data Source=c:\myFolder\myOldExcelFile.xls;Extended Properties="Excel 12.0;HDR=YES";
The office 2016 oledb is also not supported in windows server 2016. Hence what security vulnerabilities will occur when we install Office 2007 or 2016 on windows server 2016?
Any help will be highly appreeciated.
Microsoft OLEDB 12.0 is not registered on my machine.
Since you installed Access Database Engine 2010 and you received the error above, then it looks like it is a 32/64 bit problem.
Make sure you installed both redistributables 32 and 64.
If you need to install AccessDataBaseEngine x64 alongside with 32-bit installation, you need to run the installation in passive mode:
Passive mode installation steps
Open the Command Prompt by typing cmd in the Windows search box under the Start menu and selecting cmd.exe
Type the file path and file name of the 64-bit Access Database Engine 2010 install file, followed by a space and /passive (this runs the installation without showing any error messages).
Open the Registry Editor by typing regedit in the Windows search box under the Start menu and selecting regedit.exe
Delete or rename the mso.dll registry value in the following registry key:
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\FilesPaths"
More details and screenshots are found in the link below
Reference
How to install 64-bit Microsoft Database Drivers alongside 32-bit Microsoft Office

Where are ODBC drivers for MFC

I'm trying to create MFC application with DB support and during the project setup process I'm being asked to point out to location of ODBC drivers which are apparently provided with VS: https://msdn.microsoft.com/en-us/library/5f67e3x4.aspx
For the life of me I cannot find them.
Any help appreciated.
Starting with Windows XP and Windows Server 2003, ODBC drivers ship with Windows. They are located at
%WINDIR%\System32
and
%WINDIR%\SysWOW64
(for 32-bit applications running on 64-bit Windows)

Can't install LocalDB on Windows 8.1

I've developed an application that uses SQL Server (in particular LocalDB), and, I have just pushed it out to the client.
The client runs Windows 8.1 x64, but, when I try to install either x86 or x64 version of SQL LocalDB direct from Microsoft, I keep getting this error:
Microsoft SQL Server 2014 Express LocalDB
Installation of this product failed because it is not supported on this operating system. For information on supported configurations, see the product documentation.
I'm a little bit stuck here, and, quite confused as I am using LocalDB on my Windows 8.1 dev machine.
How can I resolve this?
Please right click the LocalDB setup file and check if it is configured with other compatibility mode. And make sure that you choose “Run as Administrator” to start the installation. There is also a similar thread for your reference, which may require you to reinstall the Windows to resolve the OS error.
SQL Server 2014 Express why not support Windows 8.1 Pro

KMDF on Windows Server

A bit new to the world of Windows device drivers. Using Visual Studio 2013 I create a new KMDF driver project. The configuration manager has build configs for Windows 7, 8, 8.1, but none for the server OSes (WS 2008, 2012).
Question: Which of these build targets, if any, are suitable for installation on Windows Server 2008/2012 since there are no specific build configs for them?
Thanks
This question was answered for me by Don Burn on MSDN, but I wanted to post the answer here for SO users:
Windows Server 2008 R2 == Windows 7
Windows Server 2012 == Windows 8
Windows Server 2012 R2 = Windows 8.1
As a rule you build for the earliest version of Windows you wish to support, and the driver will run on all versions after that. There are special cases where there are new capabilities that you may want to take advantage of in the newer system, but that is the general approach.
http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/64b0a2af-f885-4a9d-8239-7a6de548b298/kmdf-on-windows-server?forum=wdk

Resources