PDA

View Full Version : پروژه های مبتنی بر ADODB را در Windows 7 SP1 کامپایل نکنید!!!



M.T.P
یک شنبه 01 خرداد 1390, 19:11 عصر
چنانچه در پروژه های خود از کتابخانه ADODB برای دسترسی به بانک اطلاعاتی استفاده کرده اید از کامپایل آن در ویندوز Win7 SP1 خودداری کنید.

به نظر می رسه این موضوع منحصر به vb6 نیست و دیگر زبان های برنامه نویسی را شامل می شود.

برنامه های کامپایل شده در win7 sp1 با رفرنس Microsoft Activex Data Object در نسخه های قبلی ویندوز قابل اجرا نیست.
برنامه نویسانی که از کتابخانه نامبرده استفاده کرده اند باید منتظر HotFix باشند.

جزییات موضوع:

Breaking change in MDAC ADODB COM components in Windows 7 Service Pack 1 (repost with MSDN liveID)



There is a by design change in ADO in Windows 7 SP1 that interfaces have new GUIDs as mentioned above. The pattern is that most of all ADO interfaces (say Connection) have new GUIDs while the old GUIDs are assigned to interfaces named xxx_deprecated (say Connection_Deprecated). The reason of this change is mentioned in KB983246:

"Some ADO APIs are platform dependent in ADO 2.7 and later versions. On 64-bit versions of Windows, these ADO APIs process arguments by using a 64-bit data type (such as the LONGLONG data type). However, applications that use these APIs still use the LONG data type. Therefore, you receive a "Type Mismatch" error message when you try to run the macro."

The interfaces with new GUIDs (in Windows 7 SP1) don't have such issue.

This change causes a break that if your application is re-compiled on Windows 7 SP1 and it uses early binding to ADO, it probably doesn't work on down-level OSes, such as Windows 7 RTM, Vista, etc. Please note that this break only happens when the application is re-compiled. Existing applications should run on Windows 7 SP1 without any problems.

If you have to re-compile your application on SP1, there are several workarounds:

Request a package of KB983246 and install it on your customers' machines. Re-compiled application should work after the package is installed.
Re-write your application to use later binding to ADO, or use interfaces with name xxx_deprecated.
Keep an old version of ADO typelib (i.e., msado28.tlb) (copy from Windows 7 RTM), then compile your application with the old typelib, instead of the one in your system.
Hope these help.

پاسخ Microsoft Employee :


According to policy, I cannot disclose too much about our plan. But we are looking at any possibility to fix this issue in Win7 SP1.
At this moment, please try to work on Win7 RTM first.

Thanks,
Ming.

اطلاعات بیشتر و لینک مشکل:
http://social.msdn.microsoft.com/Forums/en/windowsgeneraldevelopmentissues/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13

sina_saravi1
سه شنبه 10 آبان 1390, 18:42 عصر
پس بگو....
من به یه خطاهای اجق وجقی میخوردم تو پروژم واسه این بود

خیلی ممنون
آقا لطف کردی

unforgiven
چهارشنبه 11 آبان 1390, 11:04 صبح
دوست عزیز
بر اساس متن انگلیسی شما این مشکل در ویندوز های 64 بیت سون وجود داره و در نسخه های 32 بیت مشکلی نیست .

M.T.P
چهارشنبه 25 آبان 1390, 00:27 صبح
دوست عزیز
بر اساس متن انگلیسی شما این مشکل در ویندوز های 64 بیت سون وجود داره و در نسخه های 32 بیت مشکلی نیست .

تو 32بیت هم همینه ، تست شده.

امین مستانی
دوشنبه 27 آذر 1391, 12:01 عصر
سلام

به نظر میرسه مایکروسافت HotFix این خطا رو ارائه کرده .

لینک توضیحات + دانلود :
http://support.microsoft.com/kb/983246


موفق باشید