How to: Use SQL in access2000 
Author Message
 How to: Use SQL in access2000

Can you give me some sample code of how to programming
sql using ADO and access2000 tables.
What I need to do is sort the records by name-key and
view them in MS DataList .

Thanks in advance for your help,

Mon, 23 Aug 2004 00:53:10 GMT  
 How to: Use SQL in access2000
Hi Eduardo,

Here is a small sample that opens an ADO recordset to an Access database,
then binds that recordset to a DataList control:

        _RecordsetPtr rs(__uuidof(Recordset));
        rs->CursorLocation = adUseClient;
        rs->Open(L"SELECT FirstName FROM Employees ORDER BY FirstName",
Source=d:\\databases\\northwind2000.mdb", adOpenStatic,
adLockBatchOptimistic, -1);

        m_datalist.SetRefRowSource(rs); //m_datalist is my DataList control. I
used the ClassWizard to create this member variable

In this example, I am just using the DataList to display the values in the
FirstName field in my Employees table. I am not actually using this value
for anything other than a display. This is the most basic way that you can
use the control.

Sarah Parra
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure?  For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit

Tue, 24 Aug 2004 07:34:33 GMT  
 [ 2 post ] 

 Relevant Pages 

1. ADOrs.Open differences between DB2/Access2000/SQL?

2. Convert a Access97 DB into Access2000 Format using DAO

3. Using Access2000 with Vicual C++ 5.0

4. Using CDaoDatabase with an Access2000 mdb File

5. Is it possible to select column_names using SQL?

6. parsing SQL using Oledb/ADI classes...

7. connect to SQL with using C#

8. Executing an Sql Script file using c#

9. Enumerate SQL Servers using managed code

10. automate sql server using C#

11. Using SQL in DOS-based compilers

12. Embedded SQL using C


Powered by phpBB® Forum Software