// Requirements
#include "ado2.h"
// 새 버전은 추가 사항이 존재 하는데 pragma message를 확인 하자면
Make sure you go to Tools.Options.Directories.Library files and add the paths to msado15.dll and msjro.dll will usually be in C:\\Program Files\\Common Files\\System\ado
라고 적혀있다.. 즉 Options->Directories Library file에 디렉토리를 추가하라는 이야기다..
// 컴파일하다 보면 아래와 같은 오류도 발생하는데 참조해보자.
[code]fatal error C1010: unexpected end of file while looking for precompiled header directive[/code]
For solving this common problem, you need to use automatic use of precompiled headers. Select Project/Settings (or ALT+F7) then, in the Project Settings dialog, select the C/C++ tab, then select the Precompiled Headers item in the combo box, and select the Automatic use of precompiled headers option.
이 오류역시 별거 없긴하는데.. 우선 ALT+F7키를 눌러서 Project Settings 를 띄운후 C/C++ tab 으로 이동... 카테고리를 Precompiled Headers 로 변경하고
그 뒤에 Radio버튼을 Automatic use of precompiled headers 옵션으로 변경하면 된다. 자 요거만 마치고 컴파일하면 에러 0, 경고 0을 볼수 있다 ㅎㅎ
[code]
// Variant Value
CADORecordset m_pRs;
CADODatabase m_pDb;
// OnInitDialog
CString strConnection = _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dbTest.mdb");
//strConnection = _T("Driver={SQL Server};Server=sysdevpdc;Trusted_Connection=Yes;Database=sysDev;uid=sa;pdw=");
if(m_pDb.Open(strConnection))
{
m_pRs = CADORecordset(&m_pDb);
if(m_pRs.Open("tblTest", CADORecordset::openTable))
//if(m_pRs.Open("sysTable01", CADORecordset::openTable))
{
m_datagridctrl.SetCaption("Clients");
m_datagridctrl.SetRefDataSource(NULL);
m_datagridctrl.SetRefDataSource((LPUNKNOWN)m_pRs.GetRecordset());
m_datagridctrl.Refresh();
}
}
else
{
AfxMessageBox(m_pDb.GetLastErrorString());
DWORD dwError = m_pDb.GetLastError();
return FALSE;
}[/code]
#include "ado2.h"
// 새 버전은 추가 사항이 존재 하는데 pragma message를 확인 하자면
Make sure you go to Tools.Options.Directories.Library files and add the paths to msado15.dll and msjro.dll will usually be in C:\\Program Files\\Common Files\\System\ado
라고 적혀있다.. 즉 Options->Directories Library file에 디렉토리를 추가하라는 이야기다..
// 컴파일하다 보면 아래와 같은 오류도 발생하는데 참조해보자.
[code]fatal error C1010: unexpected end of file while looking for precompiled header directive[/code]
For solving this common problem, you need to use automatic use of precompiled headers. Select Project/Settings (or ALT+F7) then, in the Project Settings dialog, select the C/C++ tab, then select the Precompiled Headers item in the combo box, and select the Automatic use of precompiled headers option.
이 오류역시 별거 없긴하는데.. 우선 ALT+F7키를 눌러서 Project Settings 를 띄운후 C/C++ tab 으로 이동... 카테고리를 Precompiled Headers 로 변경하고
그 뒤에 Radio버튼을 Automatic use of precompiled headers 옵션으로 변경하면 된다. 자 요거만 마치고 컴파일하면 에러 0, 경고 0을 볼수 있다 ㅎㅎ
[code]
// Variant Value
CADORecordset m_pRs;
CADODatabase m_pDb;
// OnInitDialog
CString strConnection = _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dbTest.mdb");
//strConnection = _T("Driver={SQL Server};Server=sysdevpdc;Trusted_Connection=Yes;Database=sysDev;uid=sa;pdw=");
if(m_pDb.Open(strConnection))
{
m_pRs = CADORecordset(&m_pDb);
if(m_pRs.Open("tblTest", CADORecordset::openTable))
//if(m_pRs.Open("sysTable01", CADORecordset::openTable))
{
m_datagridctrl.SetCaption("Clients");
m_datagridctrl.SetRefDataSource(NULL);
m_datagridctrl.SetRefDataSource((LPUNKNOWN)m_pRs.GetRecordset());
m_datagridctrl.Refresh();
}
}
else
{
AfxMessageBox(m_pDb.GetLastErrorString());
DWORD dwError = m_pDb.GetLastError();
return FALSE;
}[/code]
'Windows > MFC' 카테고리의 다른 글
SDI, MDI 에서 메뉴 없애기 hMenu (0) | 2013.10.02 |
---|---|
_splitpath, _wsplitpath (0) | 2013.10.02 |
A set of ADO classes - version 2.20 By Carlos Antollini (ADODB) (0) | 2013.10.02 |
CList 에서 RemoveAt 사용법 (0) | 2013.10.02 |
CListCtrl, LV_ITEM, InsertItem (lParam을 이용해 리스트에 데이터 입력하기) (0) | 2013.10.02 |