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
[35240] Re:[질문] ADO 및 MDB 사용시 질문입니다.
방태윤 [nabty] 1335 읽음    2004-05-29 11:05
Executes the SQL statement for the ADO query.

int __fastcall ExecSQL(void);

Description

Call ExecSQL to execute the SQL statement currently assigned to the SQL property. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE).

ExecSQL returns an integer value reflecting the number of rows affected by the executed SQL statement.

Note:    For SELECT statements, call Open instead of ExecSQL or set the Active property to true.

To speed performance, an application should ordinarily prepare the query by setting the Prepared property to true before calling ExecSQL for the first time.


김영욱 님이 쓰신 글 :
: DB쪽 프로그램 처음입니다.
: 막막하기만 한데요... 고수님들 도움 요청하고 싶습니다.
:
: MDB파일에서 Insert, Delete할때 문제가 생깁니다.
:
: 데이터 MDB연결은..
: ADOQuery1->ConnectionString=
:     "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
:     +ExtractFilePath(Application->ExeName)+"student.mdb"
:     ";Mode=ReadWrite;Persist Security Info=False";
:     ADOQuery1->Close();
:     ADOQuery1->SQL->Clear();
:     ADOQuery1->SQL->Add("select * from info");
:     ADOQuery1->Open();
:
: 데이터 삽입은
:     AnsiString str;
:     ADOQuery1->Close();
:     ADOQuery1->SQL->Clear();
:     str="insert into info values('"+Edit1->Text+"','"+Edit2->Text+"','"+Edit3->Text+"','"+Edit4-    
:     >Text+"','"+Edit5->Text+"')";
:     ADOQuery1->SQL->Add(str);
:     ADOQuery1->Open();

: 위처럼 하는데 위 구문을 컴파일러 상에서 실행하면
: "EOleException with message '현재공급자가 하나의 실행으로 여러개의 레코드 집합을 반환하는 것을 지원하지 않습니다." 라는 에러메시지가 발생하는데
:
: try...catch문으로 막고 컴파일하고 컴파일러가 아닌 실행파일을 바로 실행하면
: 데이터 삽입은 됩니다.
: 컴파일시에도(디버깅 때문에) 에러가 안나는 방법은 없을까요?
:
: 꼭좀 부탁드립니다.
: 김영욱 올림

+ -

관련 글 리스트
35238 [질문] ADO 및 MDB 사용시 질문입니다. 김영욱 1033 2004/05/29
35265     Re:[질문] ADO 및 MDB 사용시 질문입니다. 땅주인 1587 2004/05/31
35240     Re:[질문] ADO 및 MDB 사용시 질문입니다. 방태윤 1335 2004/05/29
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.