Why MFC Ado pplication doesn't work on another computer?










1















I have built an application using VC++ 2015, It is an MFC application I set the project "Cahracter Set= Not set" so I don't need Unicode version.



My application uses ADO to connect to database so



try {

HRESULT hr = m_pConnection.CreateInstance(__uuidof(adoNS::Connection));
if (SUCCEEDED(hr))
MessageBox(TEXT("CreateInstance succeeded!"));

catch (_com_error& e)
MessageBox(e.Description());

catch (...)
MessageBox(TEXT("OnNewDocument Exception!"));



So another handling above. When I build the project it runs fine on my computer Windows 7 x64. But If I run the application on another windows 7 I don't get any exception, no CreateInstance succeeded!??



So The problem is with ADO library how can I figure it out please?



After some search I have Copied the folder ADO from the the target machine (another computer running windows 7 x86) to my Computer (with win7 x64) and VS2015. Now I imported this new ADO library:



 #import "C:UsersUser7DesktopMyMfcProgadomsado15.dll" 
rename_namespace("adoNS")
rename("EOF", "adoEOF")


Now if I build it runs fine one both machines! So what is the problem there? Should I link to ADO of each target computer? or the problem just concerns ADO 64 bit and ADO 32 bit?



If so I have an ADO on my win7 x64:
C:Program Files (x86)Common FilesSystemado



I linked to it but the same problem?










share|improve this question
























  • @BarmakShemirani: My program is x86 and imported C:Program Files (x86) but it doesn't works on other computer with x86 the application runs but the ADO doesn't even create instance! but bringing a win7 x86 ADO library and importing it on my win7 64 bit it then works fine!!!! I mean it works on any other version of win7 x86 or x64 and even win xp. But what's the matter with win7 x64 "C:Program Files (x86)common files...ado"?

    – Maestro
    Nov 14 '18 at 18:05












  • @BarmakShemirani: But I used in my stdafx.h: #inport C:Program Files (x86)Common FilesSystemadomsado15.dll"rename_namespace("adoNS") rename("EOF", "adoEOF") But it doesn't work on other x86? I only can copy the ADO folder of win7 x86 to my machine then import this ado so when I build the application it works fine on any other computer?????!!

    – Maestro
    Nov 14 '18 at 18:40












  • I thought you said you have installed 64-bit ADO in "c:Program File (x86)...ADO" This would be wrong, and causes problems with any 32-bit programs which will access that file. Avoid installing third party components on common folder. Let the installer figure it out if possible. It should install 32-bit in that location. You could use your own file "MyMfcProgadomsado15.dll" but there could be an issue with distribution of these components.

    – Barmak Shemirani
    Nov 14 '18 at 19:56











  • @BarmakShemirani: I didn't change anything? I have two folders: C:Program filesCommon filessystemado and C:Program Files (x86)Common FilesSystemado. Could you show me how could i "you have installed 64-bit ADO in "c:Program File (x86)...ADO"? Plaease help.

    – Maestro
    Nov 14 '18 at 20:42











  • Okay I think I got confused about what you are doing. What is the value for hr from CreateInstance?

    – Barmak Shemirani
    Nov 14 '18 at 21:30















1















I have built an application using VC++ 2015, It is an MFC application I set the project "Cahracter Set= Not set" so I don't need Unicode version.



My application uses ADO to connect to database so



try {

HRESULT hr = m_pConnection.CreateInstance(__uuidof(adoNS::Connection));
if (SUCCEEDED(hr))
MessageBox(TEXT("CreateInstance succeeded!"));

catch (_com_error& e)
MessageBox(e.Description());

catch (...)
MessageBox(TEXT("OnNewDocument Exception!"));



So another handling above. When I build the project it runs fine on my computer Windows 7 x64. But If I run the application on another windows 7 I don't get any exception, no CreateInstance succeeded!??



So The problem is with ADO library how can I figure it out please?



After some search I have Copied the folder ADO from the the target machine (another computer running windows 7 x86) to my Computer (with win7 x64) and VS2015. Now I imported this new ADO library:



 #import "C:UsersUser7DesktopMyMfcProgadomsado15.dll" 
rename_namespace("adoNS")
rename("EOF", "adoEOF")


Now if I build it runs fine one both machines! So what is the problem there? Should I link to ADO of each target computer? or the problem just concerns ADO 64 bit and ADO 32 bit?



If so I have an ADO on my win7 x64:
C:Program Files (x86)Common FilesSystemado



I linked to it but the same problem?










share|improve this question
























  • @BarmakShemirani: My program is x86 and imported C:Program Files (x86) but it doesn't works on other computer with x86 the application runs but the ADO doesn't even create instance! but bringing a win7 x86 ADO library and importing it on my win7 64 bit it then works fine!!!! I mean it works on any other version of win7 x86 or x64 and even win xp. But what's the matter with win7 x64 "C:Program Files (x86)common files...ado"?

    – Maestro
    Nov 14 '18 at 18:05












  • @BarmakShemirani: But I used in my stdafx.h: #inport C:Program Files (x86)Common FilesSystemadomsado15.dll"rename_namespace("adoNS") rename("EOF", "adoEOF") But it doesn't work on other x86? I only can copy the ADO folder of win7 x86 to my machine then import this ado so when I build the application it works fine on any other computer?????!!

    – Maestro
    Nov 14 '18 at 18:40












  • I thought you said you have installed 64-bit ADO in "c:Program File (x86)...ADO" This would be wrong, and causes problems with any 32-bit programs which will access that file. Avoid installing third party components on common folder. Let the installer figure it out if possible. It should install 32-bit in that location. You could use your own file "MyMfcProgadomsado15.dll" but there could be an issue with distribution of these components.

    – Barmak Shemirani
    Nov 14 '18 at 19:56











  • @BarmakShemirani: I didn't change anything? I have two folders: C:Program filesCommon filessystemado and C:Program Files (x86)Common FilesSystemado. Could you show me how could i "you have installed 64-bit ADO in "c:Program File (x86)...ADO"? Plaease help.

    – Maestro
    Nov 14 '18 at 20:42











  • Okay I think I got confused about what you are doing. What is the value for hr from CreateInstance?

    – Barmak Shemirani
    Nov 14 '18 at 21:30













1












1








1








I have built an application using VC++ 2015, It is an MFC application I set the project "Cahracter Set= Not set" so I don't need Unicode version.



My application uses ADO to connect to database so



try {

HRESULT hr = m_pConnection.CreateInstance(__uuidof(adoNS::Connection));
if (SUCCEEDED(hr))
MessageBox(TEXT("CreateInstance succeeded!"));

catch (_com_error& e)
MessageBox(e.Description());

catch (...)
MessageBox(TEXT("OnNewDocument Exception!"));



So another handling above. When I build the project it runs fine on my computer Windows 7 x64. But If I run the application on another windows 7 I don't get any exception, no CreateInstance succeeded!??



So The problem is with ADO library how can I figure it out please?



After some search I have Copied the folder ADO from the the target machine (another computer running windows 7 x86) to my Computer (with win7 x64) and VS2015. Now I imported this new ADO library:



 #import "C:UsersUser7DesktopMyMfcProgadomsado15.dll" 
rename_namespace("adoNS")
rename("EOF", "adoEOF")


Now if I build it runs fine one both machines! So what is the problem there? Should I link to ADO of each target computer? or the problem just concerns ADO 64 bit and ADO 32 bit?



If so I have an ADO on my win7 x64:
C:Program Files (x86)Common FilesSystemado



I linked to it but the same problem?










share|improve this question
















I have built an application using VC++ 2015, It is an MFC application I set the project "Cahracter Set= Not set" so I don't need Unicode version.



My application uses ADO to connect to database so



try {

HRESULT hr = m_pConnection.CreateInstance(__uuidof(adoNS::Connection));
if (SUCCEEDED(hr))
MessageBox(TEXT("CreateInstance succeeded!"));

catch (_com_error& e)
MessageBox(e.Description());

catch (...)
MessageBox(TEXT("OnNewDocument Exception!"));



So another handling above. When I build the project it runs fine on my computer Windows 7 x64. But If I run the application on another windows 7 I don't get any exception, no CreateInstance succeeded!??



So The problem is with ADO library how can I figure it out please?



After some search I have Copied the folder ADO from the the target machine (another computer running windows 7 x86) to my Computer (with win7 x64) and VS2015. Now I imported this new ADO library:



 #import "C:UsersUser7DesktopMyMfcProgadomsado15.dll" 
rename_namespace("adoNS")
rename("EOF", "adoEOF")


Now if I build it runs fine one both machines! So what is the problem there? Should I link to ADO of each target computer? or the problem just concerns ADO 64 bit and ADO 32 bit?



If so I have an ADO on my win7 x64:
C:Program Files (x86)Common FilesSystemado



I linked to it but the same problem?







mfc ado






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 21:26









Barmak Shemirani

21.6k42347




21.6k42347










asked Nov 14 '18 at 12:28









MaestroMaestro

9911




9911












  • @BarmakShemirani: My program is x86 and imported C:Program Files (x86) but it doesn't works on other computer with x86 the application runs but the ADO doesn't even create instance! but bringing a win7 x86 ADO library and importing it on my win7 64 bit it then works fine!!!! I mean it works on any other version of win7 x86 or x64 and even win xp. But what's the matter with win7 x64 "C:Program Files (x86)common files...ado"?

    – Maestro
    Nov 14 '18 at 18:05












  • @BarmakShemirani: But I used in my stdafx.h: #inport C:Program Files (x86)Common FilesSystemadomsado15.dll"rename_namespace("adoNS") rename("EOF", "adoEOF") But it doesn't work on other x86? I only can copy the ADO folder of win7 x86 to my machine then import this ado so when I build the application it works fine on any other computer?????!!

    – Maestro
    Nov 14 '18 at 18:40












  • I thought you said you have installed 64-bit ADO in "c:Program File (x86)...ADO" This would be wrong, and causes problems with any 32-bit programs which will access that file. Avoid installing third party components on common folder. Let the installer figure it out if possible. It should install 32-bit in that location. You could use your own file "MyMfcProgadomsado15.dll" but there could be an issue with distribution of these components.

    – Barmak Shemirani
    Nov 14 '18 at 19:56











  • @BarmakShemirani: I didn't change anything? I have two folders: C:Program filesCommon filessystemado and C:Program Files (x86)Common FilesSystemado. Could you show me how could i "you have installed 64-bit ADO in "c:Program File (x86)...ADO"? Plaease help.

    – Maestro
    Nov 14 '18 at 20:42











  • Okay I think I got confused about what you are doing. What is the value for hr from CreateInstance?

    – Barmak Shemirani
    Nov 14 '18 at 21:30

















  • @BarmakShemirani: My program is x86 and imported C:Program Files (x86) but it doesn't works on other computer with x86 the application runs but the ADO doesn't even create instance! but bringing a win7 x86 ADO library and importing it on my win7 64 bit it then works fine!!!! I mean it works on any other version of win7 x86 or x64 and even win xp. But what's the matter with win7 x64 "C:Program Files (x86)common files...ado"?

    – Maestro
    Nov 14 '18 at 18:05












  • @BarmakShemirani: But I used in my stdafx.h: #inport C:Program Files (x86)Common FilesSystemadomsado15.dll"rename_namespace("adoNS") rename("EOF", "adoEOF") But it doesn't work on other x86? I only can copy the ADO folder of win7 x86 to my machine then import this ado so when I build the application it works fine on any other computer?????!!

    – Maestro
    Nov 14 '18 at 18:40












  • I thought you said you have installed 64-bit ADO in "c:Program File (x86)...ADO" This would be wrong, and causes problems with any 32-bit programs which will access that file. Avoid installing third party components on common folder. Let the installer figure it out if possible. It should install 32-bit in that location. You could use your own file "MyMfcProgadomsado15.dll" but there could be an issue with distribution of these components.

    – Barmak Shemirani
    Nov 14 '18 at 19:56











  • @BarmakShemirani: I didn't change anything? I have two folders: C:Program filesCommon filessystemado and C:Program Files (x86)Common FilesSystemado. Could you show me how could i "you have installed 64-bit ADO in "c:Program File (x86)...ADO"? Plaease help.

    – Maestro
    Nov 14 '18 at 20:42











  • Okay I think I got confused about what you are doing. What is the value for hr from CreateInstance?

    – Barmak Shemirani
    Nov 14 '18 at 21:30
















@BarmakShemirani: My program is x86 and imported C:Program Files (x86) but it doesn't works on other computer with x86 the application runs but the ADO doesn't even create instance! but bringing a win7 x86 ADO library and importing it on my win7 64 bit it then works fine!!!! I mean it works on any other version of win7 x86 or x64 and even win xp. But what's the matter with win7 x64 "C:Program Files (x86)common files...ado"?

– Maestro
Nov 14 '18 at 18:05






@BarmakShemirani: My program is x86 and imported C:Program Files (x86) but it doesn't works on other computer with x86 the application runs but the ADO doesn't even create instance! but bringing a win7 x86 ADO library and importing it on my win7 64 bit it then works fine!!!! I mean it works on any other version of win7 x86 or x64 and even win xp. But what's the matter with win7 x64 "C:Program Files (x86)common files...ado"?

– Maestro
Nov 14 '18 at 18:05














@BarmakShemirani: But I used in my stdafx.h: #inport C:Program Files (x86)Common FilesSystemadomsado15.dll"rename_namespace("adoNS") rename("EOF", "adoEOF") But it doesn't work on other x86? I only can copy the ADO folder of win7 x86 to my machine then import this ado so when I build the application it works fine on any other computer?????!!

– Maestro
Nov 14 '18 at 18:40






@BarmakShemirani: But I used in my stdafx.h: #inport C:Program Files (x86)Common FilesSystemadomsado15.dll"rename_namespace("adoNS") rename("EOF", "adoEOF") But it doesn't work on other x86? I only can copy the ADO folder of win7 x86 to my machine then import this ado so when I build the application it works fine on any other computer?????!!

– Maestro
Nov 14 '18 at 18:40














I thought you said you have installed 64-bit ADO in "c:Program File (x86)...ADO" This would be wrong, and causes problems with any 32-bit programs which will access that file. Avoid installing third party components on common folder. Let the installer figure it out if possible. It should install 32-bit in that location. You could use your own file "MyMfcProgadomsado15.dll" but there could be an issue with distribution of these components.

– Barmak Shemirani
Nov 14 '18 at 19:56





I thought you said you have installed 64-bit ADO in "c:Program File (x86)...ADO" This would be wrong, and causes problems with any 32-bit programs which will access that file. Avoid installing third party components on common folder. Let the installer figure it out if possible. It should install 32-bit in that location. You could use your own file "MyMfcProgadomsado15.dll" but there could be an issue with distribution of these components.

– Barmak Shemirani
Nov 14 '18 at 19:56













@BarmakShemirani: I didn't change anything? I have two folders: C:Program filesCommon filessystemado and C:Program Files (x86)Common FilesSystemado. Could you show me how could i "you have installed 64-bit ADO in "c:Program File (x86)...ADO"? Plaease help.

– Maestro
Nov 14 '18 at 20:42





@BarmakShemirani: I didn't change anything? I have two folders: C:Program filesCommon filessystemado and C:Program Files (x86)Common FilesSystemado. Could you show me how could i "you have installed 64-bit ADO in "c:Program File (x86)...ADO"? Plaease help.

– Maestro
Nov 14 '18 at 20:42













Okay I think I got confused about what you are doing. What is the value for hr from CreateInstance?

– Barmak Shemirani
Nov 14 '18 at 21:30





Okay I think I got confused about what you are doing. What is the value for hr from CreateInstance?

– Barmak Shemirani
Nov 14 '18 at 21:30












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300264%2fwhy-mfc-ado-pplication-doesnt-work-on-another-computer%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300264%2fwhy-mfc-ado-pplication-doesnt-work-on-another-computer%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo