Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages
Started by Bob Piskac
Fri, 16 Feb 2001 22:24
ADO try catch problems
Author: Bob Piskac
Date: Fri, 16 Feb 2001 22:24
Date: Fri, 16 Feb 2001 22:24
38 lines
2151 bytes
2151 bytes
I keep on getting an exception error before the catch handler. I am
putting the wrong password in the dialog box on purpose. What am I doing
wrong?
ls_adoString = "Provider=SQLOLEDB.1;Persist Security Info=False;";
ls_adoString = ls_adoString + "User ID =" + sle_userid->Text + ";";
ls_adoString = ls_adoString + "Data Source =" + sle_server->Text + ";";
ls_adoString = ls_adoString + "Password =" + sle_password->Text;
DataModule1->ADOConnection1->ConnectionString = ls_adoString;
try{
// Exception happens after the open call.
DataModule1->ADOConnection1->Open();
DataModule1->ADOQuery1->SQL->Clear();
DataModule1->ADOQuery1->SQL->Add("sp_databases");
DataModule1->ADOQuery1->Open();
DataModule1->DataSource1->DataSet->First();
while (DataModule1->DataSource1->DataSet->Eof == false){
ListBox1->Items->Add(DataModule1->DataSource1->DataSet->FieldByName("DAT
ABASE_NAME")->AsString );
DataModule1->DataSource1->DataSet->Next();
}
DataModule1->ADOQuery1->Close();
DataModule1->ADOConnection1->Close();
}
catch(EOleException &VCLException){
Application->MessageBox(VCLException.Message.c_str(),"Error",0L);
};
Re: ADO try catch problems
Author: Bob Piskac
Date: Mon, 19 Feb 2001 17:22
Date: Mon, 19 Feb 2001 17:22
14 lines
1311 bytes
1311 bytes
I ran the program outside of the IDE and the exception worked as programmed. >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 2/16/2001, 5:24:50 PM, Bob Piskac <bob@pbsoftware.com> wrote regarding ADO try catch problems: > I keep on getting an exception error before the catch handler. I am > putting the wrong password in the dialog box on purpose. What am I doing > wrong?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads