Using Windows 10, and XE8 Enterprise.
Components :
FDConnection1,
FDQuery1,
FDGUIxWaitCursor1
three buttons, 1 to connect, 1 to disconnect, 1 to do query.
Label1
What I've done so far :
FD Connection1 :
• ConnectionName IDMC_Azure
• DriverName MSSQL
•Params : Address : [my database name.database.windows.net - as created within the Azure ...]
•Params : Database : [database name]
•Params : DriverID : MSSQL
•Password : [mypassword]
•Server [my server - as created within the Azure ...]
• UserName : [my_user_name]
void __fastcall TForm1::Button1Click(TObject *Sender)
{
FDConnection1->Connected = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
FDConnection1->Connected = false;
}
void __fastcall TForm1::Button3Click(TObject *Sender)
{
FDConnection1->Connected = true;
FDQuery1->Active=false;
FDQuery1->SQL->Clear();
FDQuery1->SQL->Add("Select * FROM [mytable]");
FDQuery1->Active=true;
FDQuery1->Open();
FDQuery1->First();
Label1->Text=FDQuery1->FieldByName("[field_name]")->AsString;
FDQuery1->Active=false;
FDConnection1->Connected = false;
}
// just to be safe ...
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if(FDConnection1->Connected == true)
FDConnection1->Connected = false;
}
This works well with VCL.
Connection with VCL is working fantastically, but when created as Multi-Device, Works, until I close the Form, then I get a access violation at 0x... read of address 0x... ( but not always )
The intention is to be able to go to mobile devices as well, so it would be preferable if could do Multi-device.
Any ideas ?
Thanks,
Connect with Us