|
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문으로 막고 컴파일하고 컴파일러가 아닌 실행파일을 바로 실행하면
: 데이터 삽입은 됩니다.
: 컴파일시에도(디버깅 때문에) 에러가 안나는 방법은 없을까요?
:
: 꼭좀 부탁드립니다.
: 김영욱 올림
|