PDA

View Full Version : ADO يا DAO



stabesh
یک شنبه 03 بهمن 1389, 11:31 صبح
با سلام خدمت دوستان
كدام روش بهتره ؟
به گفته خود مايكروسافت DAO براي موتورهاي jet بهتره اما ADO جديدتره
حالا وقتي مي خواهيم REcordset بزنيم كدام روش بهتره ؟
اگه كه جداول link باشند كدام روش بهتره ؟
من لينكاي زير رو مطالعه كردم ولي باز هم هر كس يك حرفي ميزنه
متشكرم
http://barnamenevis.org/showthread.php?3996-dao-%DB%8C%D8%A7-ado/page2
http://support.microsoft.com/default.aspx?scid=kb;en-us;225048
http://msdn.microsoft.com/en-us/library/aa164825%28v=office.10%29.aspx
http://msdn.microsoft.com/en-us/library/aa173231%28office.11%29.aspx
http://msdn.microsoft.com/en-us/library/aa141402%28v=office.10%29.aspx
http://msdn.microsoft.com/en-us/library/aa231216%28VS.60%29.aspx
http://support.microsoft.com/kb/281998
http://msdn.microsoft.com/en-us/library/aa261340%28VS.60%29.aspx
http://msdn.microsoft.com/en-us/library/bb240097.aspx
http://social.msdn.microsoft.com/Forums/en/isvvba/thread/fbb7b0af-cc0e-4a8b-bedc-54d3a4ab082d
http://blogs.msdn.com/b/michkap/archive/2007/07/13/3849288.aspx
http://stackoverflow.com/questions/3025947/access-as-a-front-end-to-sql-server-ado-vs-dao
http://stackoverflow.com/questions/1039224/is-it-better-to-use-ado-or-dao-in-access-2007
http://groups.google.com/group/microsoft.public.data.ado/browse_frm/thread/39e18dbbc0758b79/
http://www.access-programmers.co.uk/forums/showthread.php?t=198653
http://www.dbforums.com/microsoft-access/989108-opinions-dao-vs-ado.html
http://www.tek-tips.com/viewthread.cfm?qid=1225294
http://www.tek-tips.com/viewthread.cfm?qid=1490067&page=9
http://www.tek-tips.com/viewthread.cfm?qid=1552874&page=8
http://www.tek-tips.com/viewthread.cfm?qid=1110987

stabesh
یک شنبه 03 بهمن 1389, 11:40 صبح
با سلام اين رو هم تازه ديدم

What are the Microsoft Data Access Components?

The Microsoft Data Access Components (MDAC) are the key technologies that enable Universal Data Access. Data-driven client/server applications deployed over the Web or a LAN can use these components to easily integrate information from a variety of sources, both relational (SQL) and non relational. These components include Microsoft ActiveX Data Objects (ADO), OLE DB, and Open Database Connectivity (ODBC).

ActiveX Data Objects (ADO)

ADO is the strategic application programming interface (API) to data and information. ADO provides consistent, high-performance access to data and supports a variety of development needs, including the creation of front-end database clients and middle-tier business objects that use applications, tools, languages, or Internet browsers. ADO is designed to be the one data interface needed for single and multi-tier client/server and Web-based data-driven solution development. The primary benefits of ADO are ease of use, high speed, low memory overhead, and a small disk footprint.

ADO provides an easy-to-use interface to OLE DB, which provides the underlying access to data. ADO is implemented minimal network traffic in key scenarios, and a minimal number of layers between the front end and data source-all to provide a lightweight, high-performance interface. ADO is easy to use because it uses a familiar metaphor-the COM automation interface, available from all leading Rapid Application Development (RAD) tools, database tools, and languages on the market today. ADO is a nice wrapper for OLD-DB.

OLE DB

OLE-DB is the Microsoft strategic system-level programming interface to data across the organization. OLE DB is an open specification designed to build on the success of ODBC by providing an open standard for accessing all kinds of data. Whereas ODBC was created to access relational databases, OLE DB is designed for relational and non relational information sources, including mainframe ISAM/VSAM and hierarchical databases; e-mail and file system stores; text, graphical, and geographical data; custom business objects; and more.

OLE DB defines a collection of COM interfaces that encapsulate various database management system services. These interfaces enable the creation of software components that implement such services. OLE DB components consist of data providers, which contain and expose data; data consumers, which use data; and service components, which process and transport data (such as query processors and cursor engines). OLE DB interfaces are designed to help components integrate smoothly so that OLE DB component vendors can bring high-quality OLE DB components to market quickly. In addition, OLE DB includes a bridge to ODBC to enable continued support for the broad range of ODBC relational database drivers available today.

Open Database Connectivity (ODBC)

The ODBC interface is an industry standard and a component of Microsoft Windows Open Services Architecture (WOSA). The ODBC interface makes it possible for applications to access data from a variety of database management systems (DBMSs). ODBC permits maximum interoperability-an application can access data in diverse DBMSs through a single interface. Furthermore, that application will be independent of any DBMS from which it accesses data. Users of the application can add software components called drivers, which create an interface between an application and a specific DBMS.



When should you use OLE-DB, ADO, DAO, or ODBC ?

ADO is a wrapper around OLE-DB so you can use ADO or OLE-DB.

Non-OLE environment : If a database supports ODBC and and that database is on a server that don't support OLE then ODBC is your best choice.

Non-SQL environment : ODBC is designed to work with SQL. If you have non-SQL environment then OLE-DB is better choice.

OLE environment : If you already have ODBC drives then you can use ODBC, otherwise use OLE-DB.

Interoperability required : If you need interoperable database components, then OLE-DB is your best choice.

16-Bit data access support : ADO don't support 16 bit so ODBC is the only choice.

Using multiple databases - If you are using databases that support Microsoft's jet engine then definite choice is ADO or DAO. By using ADO you get workspace level support for transaction. That means you can connect more than one database at a time in an application, which is impossible by using ODBC. You can only connect one database at a time by using ODBC.



ADO vs. DAO

ADO is a superset of DAO in functionality point of view. In fact ADO is a combination of DAO + RDO. I would prefer ADO in these cases. 1. If you are proficient in COM programming. 2. If your server supports OLE environment. 3. If you want workspace-level and multi database type ( Relational, indexed, ISAM type, text files supports ). DAO is best choice when you have DAO components installed on your machine and you are using Microsoft's jet database engine based databases such as MS-Access, SQL Server, MS-Excel or Paradox. This is fastest and easiest mathod o access databases.

DAO vs. ODBC

DAO is best choice when you have DAO components installed on your machine and you are using Microsoft's jet database engine based databases such as MS-Access, SQL Server, MS-Excel or Paradox. This is fastest and easiest method to access databases. ODBC is for various type of database which provides ODBC drives such as SQL Server, Oracle, MS-Access. Additional advantage is DAO is workspace-level support.

Advantages of DAO: Easy to use. Workspace level support. Both MFC and API provides DAO support. Speed is relatively faster than ODBC for jet database engine databases.

Advantages of ODBC : Easy to use specially when developer are not familiar with COM environment. SQL support. Both API and MFC support. Good for relational databases only.

Advantages of ADO or OLE-DB : Workspace-level support. Fastest method to access various kind of databases. Easy to use fi you are familiar with COM environment. Provides access to relational, non relational and other types of data.

RESMAILY
یک شنبه 03 بهمن 1389, 12:41 عصر
به نام خدا
باسلام اين دو كتابخانه در جاهاييكه با هم قابل مقايسه هستند طبعا برتري با ADO است. مخصوصا اگر پاي شبكه در ميان باشد و اينترنت.
الا اينكه چون در مواردي DAO داراي توابع توكار مستقيم بوده و ADO بايد از SQL استفاده نمايد، درآن موارد DAO بيشتر به كار مي آيد. در ضمن نگاهي به مطلب ضميمه بيندازيد. به كار دوستان مي خورد.

stabesh
سه شنبه 05 بهمن 1389, 12:24 عصر
با سلام
چون دیدم کسی به من جواب کاملی نداد خودم یه نتیجه ای گرفتم حالا اگر اشتباه لطفا اصلاحش کنید
DAO : این روش برای دیتابیس اکسس و ODBC بهینه شده و دارای توابع بیشتری است اما وقتی تعداد رکوردها خیلی بالا- در حد میلیون- باشه کند میشه
ADO : این روش برای لینک کردن به صورت مستقیم به دیگر دیتابیسها مثل Sql server و Oracle بهتره ولی کمی حرفه ای تره و برنامه نویسی سخت تره
منابعم هم همان لینکهای پست اول و مقاله یا شایدم کتاب پست قبلی است
در ضمن یک روش دیگر هم به نام JRO وجود داره که منابع کمی در موردش پیدا کردم نمیدونم منسوخ شده که هیچ کس ازش نمیکه یا فقط برای کار خاصی درست شده
اگر منه تازه کار رو راهنمایی کنید صواب میکنید :لبخندساده:
متشکرم

Zero Defect
سه شنبه 05 بهمن 1389, 19:34 عصر
سلام

دوست من در این خصوص در گذشته به تفصیل و کامل در اینجا بحث شده ( کلیک کنید ) (http://barnamenevis.org/showthread.php?t=147880)

گو اینکه به دلایل ضعفی که در تالار وجود داشت و همچنان هم وجود داره و روز به روز بیشتر میشه ( پست آخر اون مطلب رو مطالعه بفرمایید ) موضوع به جنجال بیمورد کشیده شد ( در راستای همون تفکر توی نظر سنجی دیگرتون شرکت کردم (http://barnamenevis.org/showthread.php?270925-%D8%B3%D8%B1%D8%B9%D8%AA-%D9%83%D8%AF%D8%A7%D9%85-%D8%AF%D8%B3%D8%AA%D9%88%D8%B1-%D8%A8%D9%8A%D8%B4%D8%AA%D8%B1-%D8%A7%D8%B3%D8%AA%D8%9F))

اینگونه مسائل بحث برانگیزی که مورد نیاز بسیاری کاربرانه , اگر به درستی مدیریت بشه و در تالار بسط داده بشن , خیلی مفیده ولی از اونجایی که ضعف مدیریت وجود داره و اینگونه مباحثی هم به دلیل اختلاف نظر پتانسیل بالایی در تبدیل شدن به جنجال رو دارن , پس در کمتر مواقعی به نتیجه نهایی میرسند ( ضعف مدیریت رو کلی عنوان میکنم و منظورم فرد خاصی نیست/لااقل در حال حاضر و اون هم تا وقتی که مدیری مطلب رو منتسب به خودش ندونسته )

امری که بی ارتباط با تعریف مدیریت نیست :

یکی از مدیران ارشد ما یک جمله رو میگفت که : بسیاری از مدیران ما از مدیریت تنها دیر اومدنش رو بلدند ( مدیران شرکت ما تا قبل از سهمیه بندی بنزین نیم ساعت دیرتر میومدن !! )

و میگفت مدیرای ما فکر میکنن مدیر یعنی : مو ( من ) + دیر

امری که بعدها متوجه شدم در خیلی جاها وجود داره , از جمله در ...

جای خالی رو در ذهنتون با کلمه مناسب پرکنید نه با اون کلمه ای که تصور میکنید در ذهن بنده هستش

با تمام این اوصاف اون مطالب که در لینک قرار داده شده ؛ جدای از جنجالش ممکنه در این مبحث به درد شما بخوره

فقط یک تبصره در خصوص اون جوابیه ها : همونطوری که در انتهای همون مبحث هم گفته شده و مجددا تاکید میشه , با توجه به تغییراتی که در اکسس در حال رخداد هستش , انتقال به ADO بدیهی به نظر میرسه که البته این امر هیچ منافاتی با برتری فعلی DAO نداره

موفق باشید