void __fastcall TSqlBuild::Run1Click(TObject *Sender)
{
//ShowMessage (Memo1->Text);
char buff [1000]; // buffer for the query
buff[0] = NULL;
int x;
// load query from memo. adding the space character at
// the end of each line as needed to maintain the word space.
x = Memo1->Lines->Count;
for (int y = 0; y < x; y++)
{
strcat (buff, Memo1->Lines->Strings [y].c_str ());
if ((buff [strlen (buff) - 1] != ' ') && (y < (x - 1)))
strcat (buff, " ");
}
// declare the Query object and call.
MHDBSQL *QUERY = new MHDBSQL;
QUERY->Open (buff);
Memo1->Lines->Add (" ");
Memo1->Lines->Add (QUERY->FieldsStr);
Memo1->Lines->Add (QUERY->TableName);
Memo1->Lines->Add (QUERY->WhereStr);
Memo1->Lines->Add (" ");
for (x = 0; x < (signed)QUERY->Fields.size (); x++)
Memo1->Lines->Add (QUERY->Fields [x].c_str ());
Memo1->Lines->Add (" ");
for (x = 0; x < (signed)QUERY->Where.size (); x++)
Memo1->Lines->Add (QUERY->Where[x].c_str ());
Memo1->Lines->Add (" ");
Memo1->Lines->Add (QUERY->error.c_str ());
Memo1->Lines->Add (" ");
AnsiString a = "The Result count is ";
Memo1->Lines->Add (a + QUERY->ResultCount);
Memo1->Lines->Add (" ");
Memo1->Lines->Add (QUERY->filename.c_str ());
delete QUERY;
//Query ("select name, time, date from address.mtb where Address1 is baytown");
}