有的话,能不能给出一点参考???谢谢!!!

解决方案 »

  1.   

    msnd vc smaple
    VC98\SDK\DBMSG
      

  2.   

    用MFC也很方便了,CRecordSet,CDatabase
      

  3.   

    为什么不用ADO如果,你是用VC++的话,可以使用ADO。
    例子如下:
    // ADOSample.cpp : Defines the entry point for the console application.
    //
    #include "stdafx.h"
    #include <objbase.h>
    #include <oledb.h>
    #include <atlbase.h>
    #include <windows.h>
    #include <comdef.h>#import "c:\\Program Files\\Common Files\\System\\ADO\\msado15.dll"  no_namespace rename("EOF", "EndOfFile")
    #import "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\sqldmo.dll" void dump_com_error(_com_error &e)
       {
    printf("Error\n");
    printf("\a\tCode = %08lx\n", e.Error());
    printf("\a\tCode meaning = %s", e.ErrorMessage());
    _bstr_t bstrSource(e.Source());
    _bstr_t bstrDescription(e.Description());
    printf("\a\tSource = %s\n", (LPCSTR) bstrSource);
    printf("\a\tDescription = %s\n", (LPCSTR) bstrDescription);
       }
    int main(int argc, char* argv[])
    {
    printf("Hello World!\n");
    ::CoInitialize(NULL); 
    try 
          { _ConnectionPtr pCon=NULL;
    _RecordsetPtr    pRs=NULL;

    pCon.CreateInstance(__uuidof(Connection)); 
    pCon->Open("Export","dongsong","dongsong",adConnectUnspecified); 

    pRs.CreateInstance(__uuidof(Recordset));
    pRs->CursorLocation=adUseClient; 
    pRs->Open("select name from sysobjects where type='u'",
    _variant_t((IDispatch *) pCon, true),adOpenStatic, adLockReadOnly, adCmdUnknown);
       while (!(pRs->EndOfFile))
       {
        
    printf("%s\n",(char*)_bstr_t(pRs->Fields->Item["name"]->Value));

    pRs->MoveNext();
       }
    }catch (_com_error &e)
          {
          dump_com_error(e);
          }
    ::CoUninitialize();
    return 0;
    }
      

  4.   

    不知道你要写个什么样的程序,用ado是个不错的选择,如果需要例子可以在msdn中找找,关于这方面的例子不是太多,但都还有点用。我就就用sdk写程序,如果可能,也许可以交流
      

  5.   

    小弟初学Windows编程,想从SDK入手,因为我原来一直是用C在Turbo C下编程。最近要考英语,但是又不满意市面上的那些背单词的软件,所以想自己编写一个。结合我正在学习SDK,所以我想用SDK来编写一个背单词的软件。主要是因为想学习一下SDK,所以我没有选择VB或DEPHI之类的工具,而是使用VC。数据库就使用ACCESS好了。对于各位大虾的回复,我一定认真学习!!!