VC 연결 oracle 데이터베이스
#import "C:\Program Files\Common Files\System\ado\msado60_Backcompat_i386.tlb" no_namespace rename("EOF","EndOfFile")
_ConnectionPtr pConn=NULL; //
2. 프로젝트 디 렉 터 리 에 SQL 새로 만 들 기connect. ini 파일, 입력
127.0.0.1 은 이 기기 가 다른 IP 에 연결 되면 이 주 소 를 직접 수정 하면 된다 는 것 을 말한다.
데이터베이스 연결
Provider=MSDAORA.1;Password=test;User ID=test;Data Source=127.0.0.1:1521/orcl;Persist Security Info=True
3. 데이터베이스 조회
if (!AfxOleInit()) // OLE/COM
{
AfxMessageBox(_T("OLE init Error"));
return FALSE;
}
//
CStdioFile file;
file.Open(_T("SQL_Connect.ini"), CFile::modeRead);
CString str=_T("");
file.ReadString(str);
file.Close();
const _bstr_t strSRC = (_bstr_t)str;
//const _bstr_t strSRC= "Provider=MSDAORA.1;Password=test;User ID=test;Data Source=localhost:1521/orcl;Persist Security Info=True";
if (FAILED(pConn.CreateInstance("ADODB.Connection")))
{
AfxMessageBox(_T("Create Instance failed!"));
exit(0);
}
try
{
pConn->Open(strSRC,"","",adModeUnknown);
}
catch(_com_error e)
{
AfxMessageBox(e.Description());
exit(0);
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
자바 작업 은 Clob 또는 NClob 데이터 형식의 저장 프로 세 스 인 스 턴 스 를 포함 합 니 다.텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.