Error when instantiating ADODB ConnectionPtr on Windows Server 2008 - c++

I have an application that I have compiled on Windows 7 64-bit. It works fine on that PC, but I am now trying to get it to work on Windows Server 2008 R2 Standard.
Whenever I try and instantiate ADODB::Connection, I receive the following error:
HRESULT : No such interface supported; hr=0x80004002
Code that generates the error is below:
CoInitialize(NULL);
_ConnectionPtr link;
link.CreateInstance(__uuidof(Connection) );
if (link == NULL) {
_com_error err(hr);
Error(err);
}
Now I found this thread: http://social.msdn.microsoft.com/Forums/vstudio/en-US/12c95ba7-60ed-4303-b4da-e811150b8d13/cannot-able-to-instance-adodbconnection-in-2008-r2-server-core-no-such-interface-supported?forum=vcgeneral, which seems to suggest the problem with a particular windows update, and provides a fix for it. However, the update that supposedly causes the problems is not on this machine, and if I try to install the fix I simply get an error saying that the update "does not apply to this computer".
Any ideas anyone? Thanks in advance.

Related

"Library not registered" error, can I determine which one exactly?

In C++ add-in for Outlook, I'm now getting "Library not registered" error. This add-in worked for ages on this machine but somehow things got broken now (although it still works fine on other machines).
Is there any way to find out which particular library is missing (not registered) without reinstalling everything? Is there a WinAPI call with some extended error information, such as the library name/path in question?
CComGITPtr< Outlook::_Application > m_GITPointer;
...
hr = m_GITPointer.CopyTo( &application ); // hr is 0x8002801d

EDSDK cpp error: 10 EDS_ERR_MISSING_SUBCOMPONENT

I am trying to get started with EDSDK to control my Canon 500D. I'm new to cpp, and windows XP apps and I'm using visual studio. After a great deal of blind trial and error I have finally managed to get the app to compile the basic sample code from the documentation. To do this I have the EDSDK.h, EDSDKTypes.h and EDSDKErrors.h headers in the right places and the EDSDK.dll and EDSDK.lib in the same folder as the code. It seems to be picking these up. I have got the 500D to be recognised by the PC so I believe the USB drivers are there.
The code is just trying to pick up the camera:
EdsError err=EDS_ERR_OK;
EdsCameraListRef cameraList=NULL;
err = EdsGetCameraList(&cameraList);
if(err == EDS_ERR_OK)
{...}
However, when I run this console app the error is picked up as 10 - which suggests, according to the document, that there is a missing subcomponent. This happens both if the camera is connected or not, so I'm thinking this is something missing from the compile. But I am getting nowhere with the documentation.
I have installed the edsdk 2.4 Windows version from a download not the official route, so this may be an issue.
Can anyone help? Specifically how can I find out what the missing subcomponent might be so I might include it. Is this a subcmponent of the build like a header file or something like a driver?
I know, old question but still it might help someone with the same problem.
From the documentation:
All DLLs are required in order to execute an EDSDK client application.
All of the modules in the DLL folder must be copied into the same folder where the EDSDK client application is in.
This means you'll have to have all DLLs beside your *.exe. Namely these DLLs:
DPPDLL.dll
DPPLibCom.dll
DPPRSC.dll
EDSDK.dll
EdsImage.dll
Mlib.dll
Ucs32P.dll

ADO objects instance creation failed on the target computer

I created an MFC application using VC++ 6.0 on my development computer installing Windows XP SP3. In this application, I used ADO objects to access SQL database server :
CoInitialize (NULL);
try
{
_ConnectionPtr pConn;
HRESULT hr = pConn.CreateInstance (__uuidof (Connection));
if (FAILED (hr))
{
AfxMessageBox ("Can't create intance of Connection");
}
//...
}
//...
Of course, the app works fine on my computer. However, I copied the whole Release folder of the app and then run it on another computer with Windows XP SP3 installed, the app failed at creating the Connection object with hr = -2147467262.
I searched on the internet much but don't see any resolution.
Does anyone know this issue and could you give me some guides on that?

mysql and c++ in vs 2010: sqlstatementhandle and connection error

I finally solved my problem:
I had been using a lib of mysql that was not compiled with the same settings as the VS10 project. Doing this solved my issue
This was my issue
I am having some trouble, and i was wondering if anyone could give me a push in the wright direction.
I am trying to connect to a local Mysql database, using c++ in VS 2010.
On phpmyadmin i can see that an attempt to connect is made but doesn't succeed.
When building the application, i get some errors.
The first where char* errors. I solved that by changing from unicode to multi byte.
The most important error, i think, is this one:
warning C4700: uninitialized local variable 'sqlstatementhandle' used.
After the application crashes i get this in visual studio:
Run-Time Check Failure #3 - The variable 'sqlstatementhandle' is being used without being initialized.
In the console i get this:
Connecting to SQL...
Connect() - SQL_ERROR
Message: [Microsoft][ODBC SQL Server Driver]Fout in het dialoogvenster
SQLSTATE: IM008
In the documentation i found that error code 008 refers to:
Dialog failed
SQLDriverConnect
But i don't really now how this can help? Is the driver not able to connect, or is the driver not loaded at all? As I told earlyer, i can see in phpmyadmin that there are failed attempts to connect.
my setup: visual studio 2010 and a mysql server administrated true Xampp. A 64bit windows 7 machine.
In connection string, Driver shows "Sql Server". Perhaps Connection String is problem. Try to change it. This site will help you.
http://www.connectionstrings.com/mysql#p31

NS_ERROR_XPC_GS_RETURNED_FAILURE error code

I'm developing extension for Firefox which calls XPCOM component writen in C++ and I get this error:
[Exception... "Component returned failure code: 0x80570016
(NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService]" nsresult: "0x80570016
(NS_ERROR_XPC_GS_RETURNED_FAILURE)" location: "JS frame ::
chrome://testtest/content/mytest.js :: loadTestPage :: line 128" data: no]
When I try to execute this code from java script:
cid = '#myCompany.com/MyComponent;1';
obj = Components.classes[cid].getService(Components.interfaces.IMyComponent);
Does anybody know what this error code means?
This error occures only on few machines running Vista (both x86 and x64) running FF 3.5.2 (32-bits official build, even after FF is reinstalled and new profiles are created), on other platforms it is working. XPCOM component is compiled with Visual C++ 2008 (sp1).
I tried to delete compreg.dat and xpti.dat and it doesn't work, I also tried to create new profile and then install extension again but still I get the same error.
I know for a fact that Firefox successfully loads my XPCOM component and that component is working, because I can access and use it from another component written in javascript.
Evaluating from error console also works.
Expression:
Components.classes['#myCompany.com/MyComponent;1'].getService(
Components.interfaces.IMyComponent);
returns:
[xpconnect wrapped IMyComponent]
Thanks!
It's also possible that you're trying to call .getService while you're still in the middle of component registration. You should not try to create any external components during registration, because they may not be registered or completely available yet.
The error means that your component threw during the getService call.