Skip to content

Commit 0c44adc

Browse files
authored
Merge pull request #1151 from msebolt/formatting-review-pr8
data formatting review pr8
2 parents 8f9a6b6 + db9a31f commit 0c44adc

11 files changed

+23
-23
lines changed

docs/data/atl-database-classes-ole-db-templates.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ Microsoft provides several implementations of OLE DB, a set of COM interfaces th
3333
[Creating an OLE DB Provider](../data/oledb/creating-an-ole-db-provider.md)
3434
[OLE DB Consumer Templates Reference](../data/oledb/ole-db-consumer-templates-reference.md)
3535
[OLE DB Provider Templates Reference](../data/oledb/ole-db-provider-templates-reference.md)
36-
[OLE DB Templates Samples](http://msdn.microsoft.com/en-us/08958863-0b5f-41ad-ae99-fca7440c553c)
36+
[OLE DB Templates Samples](http://msdn.microsoft.com/08958863-0b5f-41ad-ae99-fca7440c553c)

docs/data/changes-you-might-make-to-the-default-code-mfc-data-access.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload: ["cplusplus", "data-storage"]
1414
# Changes You Might Make to the Default Code (MFC Data Access)
1515
The [MFC Application Wizard](../mfc/reference/database-support-mfc-application-wizard.md) writes a recordset class for you that selects all records in a single table. You will often want to modify that behavior in one or more of the following ways:
1616

17-
- Set a filter or a sort order for the recordset. Do this in `OnInitialUpdate` after the recordset object is constructed but before its **Open** member function is called. For more information, see [Recordset: Filtering Records (ODBC)](../data/odbc/recordset-filtering-records-odbc.md) and [Recordset: Sorting Records (ODBC)](../data/odbc/recordset-sorting-records-odbc.md).
17+
- Set a filter or a sort order for the recordset. Do this in `OnInitialUpdate` after the recordset object is constructed but before its `Open` member function is called. For more information, see [Recordset: Filtering Records (ODBC)](../data/odbc/recordset-filtering-records-odbc.md) and [Recordset: Sorting Records (ODBC)](../data/odbc/recordset-sorting-records-odbc.md).
1818

1919
- Parameterize the recordset. Specify the actual run-time parameter value after the filter. For more information, see [Recordset: Parameterizing a Recordset (ODBC)](../data/odbc/recordset-parameterizing-a-recordset-odbc.md)
2020

docs/data/command-handlers-for-record-scrolling-mfc-data-access.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ ms.workload: ["cplusplus", "data-storage"]
1414
# Command Handlers for Record Scrolling (MFC Data Access)
1515
The [CRecordView](../mfc/reference/crecordview-class.md) class provides default command handling for the following standard commands:
1616

17-
- **ID_RECORD_MOVE_FIRST**
17+
- ID_RECORD_MOVE_FIRST
1818

19-
- **ID_RECORD_MOVE_LAST**
19+
- ID_RECORD_MOVE_LAST
2020

21-
- **ID_RECORD_MOVE_NEXT**
21+
- ID_RECORD_MOVE_NEXT
2222

23-
- **ID_RECORD_MOVE_PREV**
23+
- ID_RECORD_MOVE_PREV
2424

2525
The `OnMove` member function provides default command handling for all four commands, which move from record to record. As these commands are issued, RFX (or DFX) loads the new record into the recordset's fields and DDX moves the values into the record form's controls. For information about RFX, see [Record Field Exchange (RFX)](../data/odbc/record-field-exchange-rfx.md).
2626

docs/data/data-access-programming-mfc-atl.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ OLE DB is a low-level, high-performance API based on the COM specification, and
1818

1919
If your legacy application uses OLE DB or the higher-level ADO interface to connect to SQL Server, and you are not accessing linked servers, you should consider migrating to ODBC in the near future. If you do not require cross-platform portability or the latest SQL Server features, you can possibly use the Microsoft OLE DB Provider for ODBC (MSDASQL). MSDASQL allows applications that are built on OLE DB and ADO (which uses OLEDB internally) to access data sources through an ODBC driver. As with any translation layer, MSDASQL can impact database performace. You should test to determine whether the impact is signifant for your application. MSDASQL ships with the Windows operating system, and Windows Server 2008 & Windows Vista SP1 are the first Windows releases to include a 64-bit version of the technology.
2020

21-
The SQL Native Client component (SNAC), which packages OLE DB and ODBC drivers in a single DLL, is deprecated for ODBC applications. The SQL Server 2012 version of SNAC (SQLNCLI11.DLL) ships with SQL Server 2016 because other SQL Server components depend on it. However, new C++ applications that connect to SQL Server or Azure SQL Database via ODBC should use [the most recent ODBC driver](https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server). For more information, see [SQL Server Native Client Programming](/sql/relational-databases/native-client/sql-server-native-client-programming)
21+
The SQL Native Client component (SNAC), which packages OLE DB and ODBC drivers in a single DLL, is deprecated for ODBC applications. The SQL Server 2012 version of SNAC (SQLNCLI11.DLL) ships with SQL Server 2016 because other SQL Server components depend on it. However, new C++ applications that connect to SQL Server or Azure SQL Database via ODBC should use [the most recent ODBC driver](https://docs.microsoft.com/sql/connect/odbc/download-odbc-driver-for-sql-server). For more information, see [SQL Server Native Client Programming](/sql/relational-databases/native-client/sql-server-native-client-programming)
2222

2323
If you use C++/CLI, you can continue to use ADO.NET as always. For more information, see [Data Access Using ADO.NET (C++/CLI)](../dotnet/data-access-using-adonet-cpp-cli.md), and [Accessing data in Visual Studio](/visualstudio/data-tools/accessing-data-in-visual-studio).
2424

@@ -29,4 +29,4 @@ For more information about the history of data access technologies on Microsoft
2929
## See Also
3030
[Data Access](data-access-in-cpp.md)
3131
[Microsoft Open Database Connectivity (ODBC)](https://docs.microsoft.com/sql/odbc/microsoft-open-database-connectivity-odbc)
32-
[Data Access Technologies Road Map](https://msdn.microsoft.com/en-us/library/ms810810.aspx)
32+
[Data Access Technologies Road Map](https://msdn.microsoft.com/library/ms810810.aspx)

docs/data/filling-a-list-box-from-a-second-recordset-mfc-data-access.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ By default, a record view is associated with a single recordset object, whose fi
3131

3232
5. Initialize the selection in the combo box.
3333

34-
```
34+
```cpp
3535
void CSectionForm::OnInitialUpdate()
3636
{
3737
// ...

docs/data/mfc-database-classes-odbc-and-dao.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.workload: ["cplusplus", "data-storage"]
1616
> Microsoft recommends using ODBC via Microsoft ODBC Driver 13 (or later) for SQL Server for new projects. DAO is no longer supported.
1717
1818
For more information, see the following topics:
19-
- [Data Access Technologies Road Map](https://msdn.microsoft.com/en-us/library/ms810810.aspx)
19+
- [Data Access Technologies Road Map](https://msdn.microsoft.com/library/ms810810.aspx)
2020

2121
- [ODBC Driver 13.1 for SQL Server released](https://blogs.technet.microsoft.com/dataplatforminsider/2016/08/03/odbc-driver-13-1-for-sql-server-released/) Microsoft ODBC Driver 13 for SQL Server should be used to create new applications or enhance existing applications that need to take advantage of new SQL Server 2016 features.
2222

docs/data/mfc-using-database-classes-with-documents-and-views.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ You can use the MFC database classes with or without the document/view architect
3636

3737
- If you are accessing a recordset in a local context, create a `CRecordset` object locally in member functions of the document or the view, as needed.
3838

39-
Declare a recordset object as a local variable in a function. Pass **NULL** to the constructor, which causes the framework to create and open a temporary `CDatabase` object for you. As an alternative, pass a pointer to a `CDatabase` object. Use the recordset within the function and let it be destroyed automatically when the function exits.
39+
Declare a recordset object as a local variable in a function. Pass NULL to the constructor, which causes the framework to create and open a temporary `CDatabase` object for you. As an alternative, pass a pointer to a `CDatabase` object. Use the recordset within the function and let it be destroyed automatically when the function exits.
4040

41-
When you pass **NULL** to a recordset constructor, the framework uses information returned by the recordset's `GetDefaultConnect` member function to create a `CDatabase` object and open it. The wizards implement `GetDefaultConnect` for you.
41+
When you pass NULL to a recordset constructor, the framework uses information returned by the recordset's `GetDefaultConnect` member function to create a `CDatabase` object and open it. The wizards implement `GetDefaultConnect` for you.
4242

4343
- If you are accessing a recordset during the lifetime of your document, embed one or more `CRecordset` objects in your document.
4444

45-
Construct the recordset objects either when you initialize the document or as needed. You might write a function that returns a pointer to the recordset if it already exists or constructs and opens the recordset if it does not exist yet. Close, delete, and recreate the recordset as needed, or call its **Requery** member function to refresh the records.
45+
Construct the recordset objects either when you initialize the document or as needed. You might write a function that returns a pointer to the recordset if it already exists or constructs and opens the recordset if it does not exist yet. Close, delete, and recreate the recordset as needed, or call its `Requery` member function to refresh the records.
4646

4747
- If you are accessing a data source during the lifetime of your document, embed a `CDatabase` object or store a pointer to a `CDatabase` object in it.
4848

49-
The `CDatabase` object manages a connection to your data source. The object is constructed automatically during document construction, and you call its **Open** member function when you initialize the document. When you construct recordset objects in document member functions, you pass a pointer to the document's `CDatabase` object. This associates each recordset with its data source. The database object is usually destroyed when the document closes. The recordset objects are typically destroyed when they exit the scope of a function.
49+
The `CDatabase` object manages a connection to your data source. The object is constructed automatically during document construction, and you call its `Open` member function when you initialize the document. When you construct recordset objects in document member functions, you pass a pointer to the document's `CDatabase` object. This associates each recordset with its data source. The database object is usually destroyed when the document closes. The recordset objects are typically destroyed when they exit the scope of a function.
5050

5151
## <a name="_core_other_factors"></a> Other Factors
52-
Form-based applications often do not have any use for the framework's document serialization mechanism, so you might want to remove, disable, or replace the `New` and **Open** commands on the **File** menu. See the article [Serialization: Serialization vs. Database Input/Output](../mfc/serialization-serialization-vs-database-input-output.md).
52+
Form-based applications often do not have any use for the framework's document serialization mechanism, so you might want to remove, disable, or replace the **New** and **Open** commands on the **File** menu. See the article [Serialization: Serialization vs. Database Input/Output](../mfc/serialization-serialization-vs-database-input-output.md).
5353

5454
You might also want to make use of the many user-interface possibilities that the framework can support. For example, you could use multiple `CRecordView` objects in a splitter window, open multiple recordsets in different multiple document interface (MDI) child windows, and so on.
5555

docs/data/mfc-using-database-classes-without-documents-and-views.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ Sometimes you might not want to use the framework's document/view architecture i
3838

3939
|Option|View|Document|
4040
|------------|----------|--------------|
41-
|**None**|Derived from `CView`.|Provides no database support. This is the default option.<br /><br /> If you select the **Document/view architecture support** option on the [Application Type, MFC Application Wizard](../mfc/reference/application-type-mfc-application-wizard.md) page, you get full document support including serialization and `New`, **Open**, **Save**, and **Save As** commands on the **File** menu. See [Applications with No Document](#_core_applications_with_no_document).|
41+
|**None**|Derived from `CView`.|Provides no database support. This is the default option.<br /><br /> If you select the **Document/view architecture support** option on the [Application Type, MFC Application Wizard](../mfc/reference/application-type-mfc-application-wizard.md) page, you get full document support including serialization and **New**, **Open**, **Save**, and **Save As** commands on the **File** menu. See [Applications with No Document](#_core_applications_with_no_document).|
4242
|**Header files only**|Derived from `CView`.|Provides the basic level of database support for your application.<br /><br /> Includes Afxdb.h. Adds link libraries, but does not create any database-specific classes. You can create recordsets later and use them to examine and update records.|
43-
|**Database view without file support**|Derived from `CRecordView`|Provides document support but no serialization support. Document can store recordset and coordinate multiple views; does not support serialization or the `New`, **Open**, **Save**, and **Save As** commands. See [Applications with Minimal Documents](#_core_applications_with_minimal_documents). If you include a database view, you must specify the source of the data.<br /><br /> Includes database header files, link libraries, a record view, and a recordset. (Available only for applications with the **Document/view architecture support** option selected on the [Application Type, MFC Application Wizard](../mfc/reference/application-type-mfc-application-wizard.md) page.)|
43+
|**Database view without file support**|Derived from `CRecordView`|Provides document support but no serialization support. Document can store recordset and coordinate multiple views; does not support serialization or the **New**, **Open**, **Save**, and **Save As** commands. See [Applications with Minimal Documents](#_core_applications_with_minimal_documents). If you include a database view, you must specify the source of the data.<br /><br /> Includes database header files, link libraries, a record view, and a recordset. (Available only for applications with the **Document/view architecture support** option selected on the [Application Type, MFC Application Wizard](../mfc/reference/application-type-mfc-application-wizard.md) page.)|
4444
|**Database view with file support**|Derived from `CRecordView`|Provides full document support, including serialization and document-related **File** menu commands. Database applications typically operate on a per-record basis rather than on a per-file basis and so do not need serialization. However, you might have a special use for serialization. See [Applications with Minimal Documents](#_core_applications_with_minimal_documents). If you include a database view, you must specify the source of the data.<br /><br /> Includes database header files, link libraries, a record view, and a recordset. (Available only for applications with the **Document/view architecture support** option selected on the [Application Type, MFC Application Wizard](../mfc/reference/application-type-mfc-application-wizard.md) page.)|
4545

4646
For a discussion of alternatives to serialization and alternative uses for serialization, see [Serialization: Serialization vs. Database Input/Output](../mfc/serialization-serialization-vs-database-input-output.md).
@@ -75,7 +75,7 @@ Sometimes you might not want to use the framework's document/view architecture i
7575
### <a name="_core_writing_applications_without_documents"></a> Writing Applications Without Documents
7676
Because the application wizard does not support creating applications without documents, you must write your own `CWinApp`-derived class and, if needed, also create a `CFrameWnd` or `CMDIFrameWnd` class. Override `CWinApp::InitInstance` and declare an application object as:
7777

78-
```
78+
```cpp
7979
CYourNameApp theApp;
8080
```
8181

@@ -90,7 +90,7 @@ CYourNameApp theApp;
9090

9191
Because no document owns the `CRecordset` object, you probably want to store it as an embedded data member in your `CWinApp`-derived application class. Alternatives include:
9292

93-
- Not keeping a permanent `CRecordset` object at all. You can pass **NULL** to your recordset class constructors. In that case, the framework creates a temporary `CDatabase` object using the information in the recordset's `GetDefaultConnect` member function. This is the most likely alternative approach.
93+
- Not keeping a permanent `CRecordset` object at all. You can pass NULL to your recordset class constructors. In that case, the framework creates a temporary `CDatabase` object using the information in the recordset's `GetDefaultConnect` member function. This is the most likely alternative approach.
9494

9595
- Making the `CRecordset` object a global variable. This variable should be a pointer to a recordset object that you create dynamically in your `CWinApp::InitInstance` override. This avoids attempting to construct the object before the framework is initialized.
9696

docs/data/odbc/odbc-calling-odbc-api-functions-directly.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The database classes provide a simpler interface to a [data source](../../data/o
2929

3030
- Deallocate storage when you finish.
3131

32-
For more information about these steps, see the [Open Database Connectivity (ODBC)](https://msdn.microsoft.com/en-us/library/ms710252.aspx) SDK in the MSDN documentation.
32+
For more information about these steps, see the [Open Database Connectivity (ODBC)](https://msdn.microsoft.com/library/ms710252.aspx) SDK in the MSDN documentation.
3333

3434
In addition to these steps, you need to take extra steps to check function return values, ensure that your program is not waiting for an asynchronous call to finish, and so on. You can simplify these last steps by using the AFX_SQL_ASYNC and AFX_SQL_SYNC macros. For more information, see [Macros and Globals](../../mfc/reference/mfc-macros-and-globals.md) in the *MFC Reference*.
3535

docs/data/odbc/odbc-driver-requirements-for-dynasets.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.workload: ["cplusplus", "data-storage"]
1414
# ODBC Driver Requirements for Dynasets
1515
In the MFC ODBC database classes, dynasets are recordsets with dynamic properties; they remain synchronized with the data source in certain ways. MFC dynasets (but not forward-only recordsets) require an ODBC driver with Level 2 API conformance. If the driver for your [data source](../../data/odbc/data-source-odbc.md) conforms to the Level 1 API set, you can still use both updateable and read-only snapshots and forward-only recordsets, but not dynasets. However, a Level 1 driver can support dynasets if it supports extended fetch and keyset-driven cursors.
1616

17-
In ODBC terminology, dynasets and snapshots are referred to as cursors. A cursor is a mechanism used for keeping track of its position in a recordset. For more information about driver requirements for dynasets, see [Dynaset](../../data/odbc/dynaset.md). For more information about cursors, see the [Open Database Connectivity (ODBC)](https://msdn.microsoft.com/en-us/library/ms710252.aspx) SDK in the MSDN documentation.
17+
In ODBC terminology, dynasets and snapshots are referred to as cursors. A cursor is a mechanism used for keeping track of its position in a recordset. For more information about driver requirements for dynasets, see [Dynaset](../../data/odbc/dynaset.md). For more information about cursors, see the [Open Database Connectivity (ODBC)](https://msdn.microsoft.com/library/ms710252.aspx) SDK in the MSDN documentation.
1818

1919
> [!NOTE]
2020
> For updateable recordsets, your ODBC driver must support either positioned update statements or the `::SQLSetPos` ODBC API function. If both are supported, MFC uses `::SQLSetPos` for efficiency. Alternatively, for snapshots, you can use the cursor library, which provides the required support for updateable snapshots (static cursors and positioned update statements).

0 commit comments

Comments
 (0)