AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 03.11.2006, 22:54   #1  
Blog bot is offline
Blog bot
Участник
 
25,477 / 846 (79) +++++++
Регистрация: 28.10.2006
Dynamics AX: CCADO Classes in Dynamics AX 4.0
Источник: http://dynamics-ax.blogspot.com/2006...ics-ax-40.html
==============
I wanted to take a quick break from my series on the future of Dynamics AX and Web 2.0, and talk a little bit about the CCADO classes. These classes represent a new way to access external data through code within DAX, which allows for the use of ADO vs. ODBC classes.

For me this is a wonderful step in the right direction, in which to be honest I missed. I missed the ability of creating object that represent table's through the use of ADO Recordsets. Now this is wonderful! The classes that are avaliable for this are:

CCADOConnection
CCADORecordSet
CCADOFields
CCADOField

The above classes can be made use to create an ADO connection to a given database, and then create multiple ADO RecordSets to work with.

Now let look at using these classes. When creating new code to make use of ADO Connection and recordset's, you always have to start with a connection. So the first class that you want to make use of would be the CCADOConnection object. With this object you can create your recordset through the use of a connection string. Once you have your connection, then you can build a recordset by creating a new CCADORecordSet object and call the .open() method with passing it the CCADOConnection open along with the T-SQL statement to retrieve the dataset with. The other two classes metioned above can be made use of for working with the Fields and a single Field within the RecordSet. Now there are other objects like the Command object which can be made use to execute updates and deletes, etc.

I want to mention here that all code should be design and developed in an OO way. Meaning that instead of working with raw Connections and RecordSets, you want to create objects that represent the data you are wanting to work with that handles the underlying updating, viewing, etc. With this you can then move forward in the right direction. To speak by example, if you have a table that contained: SID, UserName, Password, FirstName, LastName and you wanted to work with that table through ADO, then you would start out with creating an X++ class that represent the data as an object. So you would create a class that extended from the CCADORecordSet class that would have SID, UserName, Password, FirstName, and LastName as Parms of that class. The new would create the needed connection, and then you could choose to fill the who table and work with it as such, or supply a certian where clause to the end of the given T-SQL statement used to created and fill the object.

Well Check back soon as I continue on my path talking about the future for Dynamics AX and Web 2.0. The above though I wanted to get out here as it is Very useful, and very handy, and I am glad to see it replacing the use of the Older ODBCConnection classes.

Find a job at: www.DynamicsAXJobs.com


==============
Источник: http://dynamics-ax.blogspot.com/2006...ics-ax-40.html
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics AX: Managing Your Supply Chain Using Microsoft Dynamics AX 2009 - Book Review Blog bot DAX Blogs 0 31.03.2009 23:06
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15
Inside Dynamics AX 4.0: Inside the Business Connector Blog bot DAX Blogs 0 04.10.2007 05:15
Сергей Герасимов: Что нового в Microsoft Dynamics AX 4.0 Blog bot DAX Blogs 0 16.01.2007 11:00

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 12:19.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.