Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: ClientDataset Exception on Machine without IDE


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jan 26, 2015 9:33 PM Last Post By: Barry Andrews
Barry Andrews

Posts: 71
Registered: 9/19/03
ClientDataset Exception on Machine without IDE  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2015 6:12 PM
I have a very simple database application just copying from SQL Server database to SQLite database.
On both of my development machines the code runs fine (Windows 7 - 64 bit and windows 8.1 64bit)
However when I deploy onto a machine which doesn't have the IDE I get an exception, read from address 00000 when I try to open the Client dataset.

I have tried to work out where the address is within the code, but my C++ Builder XE7 professional wont allow me to step into the embarcadero source.
Looking at the assembly it seems to be somewhere in fetch params.

Here s my code, what am I not initialising that ClientDataset needs?
The SQLQuery, ClientDataset, DataSource and DataSetProvider are all design time components with no change to default values

TempSQLQuery->Active = false;
TempClientDataSet->Active = false;
TempSQLQuery->SQLConnection = SQLServerConnection;
TempSQLQuery->SQL->Clear();
TempSQLQuery->Params->Clear();
TempSQLQuery->SQL->Add("Select * from INFORMATION_SCHEMA.COLUMNS ORDER BY TABLE_NAME ASC");
TempDataSetProvider->DataSet = TempSQLQuery;
TempClientDataSet->ProviderName = TempDataSetProvider->Name;
TempDataSource->DataSet = TempClientDataSet;
try
{
TempClientDataSet->Active = true;
}
catch (Exception &E)
{
String Msg;
Msg = "Bugger: Exception occurred in CopyTables: " + E.Message;
MyMemo->Lines->Add(Msg);
}

I have also tried creating components at run time

TSQLQuery * TempSQLQuery = NULL;
TClientDataSet * TempClientDataSet = NULL;
TDataSetProvider * TempDataSetProvider = NULL;
TDataSource * TempDataSource = NULL;

TempClientDataSet = new TClientDataSet(this);
TempClientDataSet->Active = false;
TempDataSetProvider = new TDataSetProvider(this);
TempDataSetProvider->Name = "TempDataSetProvider";
TempSQLQuery = new TSQLQuery(this);
TempDataSource = new TDataSource(this);

TempSQLQuery->Active = false;
TempClientDataSet->Active = false;
TempSQLQuery->SQLConnection = SQLServerConnection;
TempSQLQuery->SQL->Clear();
TempSQLQuery->Params->Clear();
TempSQLQuery->SQL->Add("Select * from INFORMATION_SCHEMA.COLUMNS ORDER BY TABLE_NAME ASC");
TempDataSetProvider->DataSet = TempSQLQuery;
TempClientDataSet->ProviderName = TempDataSetProvider->Name;
TempDataSource->DataSet = TempClientDataSet;
try
{
TempClientDataSet->Active = true;
}
catch (Exception &E)
{
String Msg;
Msg = "Bugger: Exception occurred in CopyTables: " + E.Message;
MyMemo->Lines->Add(Msg);
}

Runs fine on the machines with the IDE installed, both under the IDE and just running the generated exe.
But on another machine without the IDE, it gives the exception!
Error occurs with both XE4 and XE7 builds

Edited by: Barry Andrews on Jan 26, 2015 6:26 PM
Barry Andrews

Posts: 71
Registered: 9/19/03
Re: ClientDataset Exception on Machine without IDE  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 26, 2015 9:33 PM   in response to: Barry Andrews in response to: Barry Andrews
Found the reason for the error, needed to statically link Midas.lib and that removed the exception.
Took a bit of searching to find the answer so if you need to statically link the midas.lib into C++ Builder Project

http://cc.embarcadero.com/Item.aspx?id=23881
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02