The
following file is available for download from the Microsoft Download
Center:
Release Date:
9-29-2000
For additional information about how to download Microsoft
Support files, click the following article number to view the article in the
Microsoft Knowledge Base:
119591�
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most
current virus-detection software that was available on the date that the file
was posted. The file is stored on security-enhanced servers that help to
prevent any unauthorized changes to the file.
The STonSel.exe file contains the following files:
Collapse this tableExpand this table
File name | Size |
---|
EULA.txt | 2 KB |
STonSel.cpp | 5 KB |
The ADO
Record object in ADO 2.6 has been enhanced to support the retrieval of a
single
Record. The data obtained is read-only. In case the query results in
more than one record, only the first record encountered is returned. The sample
performs the following to retrieve one single record:
- Sets up a connection to a SQL Server 2000 database:
_bstr_t m_Conn("PROVIDER=SQLOLEDB.1;SQL2000Server=Server;Database=Northwind;uid=sa;pwd=;");
hr = conn->Open(m_Conn,L"",L"",-1);
- Sets up the ADO Record to contain the query:
hr = rec->put_Source(L"SELECT * FROM CUSTOMERS WHERE CUSTOMERID='ALFKI'");
- Opens the Record object by using the adExecuteCommand enumeration:
hr = rec->Open(vtEmpty,vtEmpty,adModeReadWrite,adFailIfNotExists, adOpenExecuteCommand,L"",L"");
Steps to Run the Sample
- Create an empty Win32 console application.
- Insert STonSel.cpp into the project.
- Modify the connection string to refer to a valid SQL Server
2000 database.
- Compile and then run the application.