C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[38206] 어떻게 ado-access에서 create table명령을 내리나요.
이재민 [] 1259 읽음    2004-11-29 17:15
허접 답변 사양  소스만 컴파일해도 알수있게 답해줘요.
자신 없음 다음 문장에 대해서만이라도 설명해주세요
--> CreateObject("ADODB.Recordset");

질문 드리고 싶은건 첨부되 파일 소스를 수정해서 인위적으로 create table [tablename]어쩌구 저쩌구도 코드 상에서
실해이 되서 동적으로 테이블을 만들고 싶다는 겁니다.

http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=19860
여기에 있는 소스(검색에서 ado access)  받아서 공부 하고 있는데요
table 생성을 어떻게 해야하는지 잘 모르겠습니다.

다음은 mdb 여는 부분이고요...
OpenDialog1->Title="Open MS Access database";
Create=false;

if(OpenDialog1->Execute())
       {
        if(!FileExists(Form1->OpenDialog1->FileName))
         {
          ShowMessage("File is not exist");
          return;
         }
        Form1->Catalog.Exec(PropertySet("ActiveConnection") <<
                ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Form1->OpenDialog1->FileName));
        Form1->Label2->Caption=Form1->OpenDialog1->FileName;
        ListBox1->Clear();
        Form1->CatTables=Form1->Catalog.Exec(Function("Tables"));
        //numbers of tables
        int NumTables=Form1->CatTables.Exec(PropertyGet("Count"));
        Form4->ListBox1->Clear();
        for(int i=0; i<NumTables; ++i)
         {
           Variant item=Form1->CatTables.Exec(PropertyGet("Item") << i);
           Form1->ListBox1->Items->AddObject(item.Exec(PropertyGet("Name")),(TObject*)(IDispatch*)item);
         }
       }

다음은 mdb 만드는 부분입니다.
OpenDialog1->Title="Create MS Access database";
Create=true;
if(OpenDialog1->Execute())
       {
        if(FileExists(Form1->OpenDialog1->FileName))
         {
          ShowMessage("File exist and will be recreated");
          DeleteFile(Form1->OpenDialog1->FileName);
         }
        Form1->ListBox1->Clear();
        Form1->Catalog.Exec(Function("Create") <<
              ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Form1->OpenDialog1->FileName));
        Form1->Label2->Caption=Form1->OpenDialog1->FileName;
       }

try
        {
         RecordSetDB=Variant::CreateObject("ADODB.Recordset");
        }
catch(EOleSysError &err)
        {
         Application->MessageBox("Could not create Recordset object",err.Message.c_str(),MB_OK);
         Application->Terminate();
         return;
        }
..
..
..
..
도대체 .Exec(PropertySet ... 이런건 어딜 참고로 만들어 지는지 알수가 없네요

+ -

관련 글 리스트
38206 어떻게 ado-access에서 create table명령을 내리나요. 이재민 1259 2004/11/29
38257     Re:어떻게 ado-access에서 create table명령을 내리나요. bhp영화 1258 2004/12/02
38260         Re:Re:어떻게 ado-access에서 create table명령을 내리나요. 이재민 946 2004/12/02
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.