Недопустимая строка с указанием класса

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
TEMRUS
Posts: 6
Joined: Tue 01 Feb 2011 12:06

Недопустимая строка с указанием класса

Post by TEMRUS » Tue 05 Jul 2011 19:13

Hi!
I've a trouble with TMSQuery and TMSStoredProc when Im trying to execute SP ONLY thru these components.
After starting execution an error box are showing.
But all SP's still executable under MSSMS.

Code: Select all

mspFlowDocSearchByAttr->Active=false;                       	if (cxDateEdit3->Text==NULL) mspFlowDocSearchByAttr->ParamByName("FlowDocDateStart")->Value.IsNull();
		else  mspFlowDocSearchByAttr->ParamByName("FlowDocDateStart")->AsDate = cxDateEdit3->Date;
	if (cxDateEdit1->Text==NULL) mspFlowDocSearchByAttr->ParamByName("FlowDocDateEnd")->Value.IsNull();
		else  mspFlowDocSearchByAttr->ParamByName("FlowDocDateEnd")->AsDate   = cxDateEdit1->Date;
	mspFlowDocSearchByAttr->ParamByName("FlowDocCode")->Value=cxTextEdit2->Text;
	mspFlowDocSearchByAttr->ParamByName("FlowDocDirID")->Value=cxLookupComboBox2->EditText;
	mspFlowDocSearchByAttr->ParamByName("FlowDocTypeID")->Value=cxLookupComboBox1->EditText;
	mspFlowDocSearchByAttr->ParamByName("FlowDocFromID")->Value=cxLookupComboBox3->EditText;
	mspFlowDocSearchByAttr->ParamByName("FlowDocToID")->Value=cxLookupComboBox4->EditText;
	if (cxDateEdit2->Text==NULL) mspFlowDocSearchByAttr->ParamByName("FlowDocPodrazdDate")->Value.IsNull();
		else mspFlowDocSearchByAttr->ParamByName("FlowDocPodrazdDate")->Value=cxDateEdit2->Date;
	mspFlowDocSearchByAttr->ParamByName("FlowDocPodrazdNum")->Value=Trim(cxTextEdit1->Text);
	mspFlowDocSearchByAttr->ParamByName("FlowDocIsDeleted")->Value=0;
	mspFlowDocSearchByAttr->ParamByName("FlowDocUserLogin")->Value=Trim(cxTextEdit3->Text);
      mspFlowDocSearchByAttr->ExecProc(); //ERROR AFTER EXEC OF THIS LINE 
Copy of this question at: http://www.sql.ru/forum/actualthread.aspx?tid=863893
I'm using RAD XE, SDAC 5.10pro, MSSQL2008

AndreyZ

Post by AndreyZ » Wed 06 Jul 2011 09:22

Hello,

SDAC doesn't raise the EOleSysError error, it's raised by OLEDB. Please check if this error is caused by connection establishment attempt in the following way:

Code: Select all

MSConnection.Open;
Does this error occur here?

TEMRUS
Posts: 6
Joined: Tue 01 Feb 2011 12:06

Post by TEMRUS » Wed 06 Jul 2011 11:05

AndreyZ wrote:Hello,

SDAC doesn't raise the EOleSysError error, it's raised by OLEDB. Please check if this error is caused by connection establishment attempt in the following way:

Code: Select all

MSConnection.Open;
Does this error occur here?
Connection is raised automatically after program starts.
I execute SP's after connection to the DB.

Maybe problem with SP's that called thru your components?
Because, if I define a query in the query box inside TMSQuery - it works properly, without errors.

AndreyZ

Post by AndreyZ » Wed 06 Jul 2011 13:31

Please send a script to create your stored procedure to andreyz*devart*com.

TEMRUS
Posts: 6
Joined: Tue 01 Feb 2011 12:06

Post by TEMRUS » Wed 06 Jul 2011 20:31

Subj problem error has been resolved when I've removed an inbound parameter with GUID datatype.

AndreyZ

Post by AndreyZ » Thu 07 Jul 2011 07:23

To solve the problem, you should use the AsString property instead of the Value property for uniqueidentifier parameters. Here is an example:

Code: Select all

mspFlowDocSearchByAttr->ParamByName("FlowDocFromID")->AsString=cxLookupComboBox3->EditText;
mspFlowDocSearchByAttr->ParamByName("FlowDocToID")->AsString=cxLookupComboBox4->EditText;

TEMRUS
Posts: 6
Joined: Tue 01 Feb 2011 12:06

Post by TEMRUS » Thu 07 Jul 2011 12:01

Problem solved this way. Thanx all.

Post Reply