Page 1 of 1

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

Posted: Tue 05 Jul 2011 19:13
by TEMRUS
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

Posted: Wed 06 Jul 2011 09:22
by AndreyZ
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?

Posted: Wed 06 Jul 2011 11:05
by TEMRUS
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.

Posted: Wed 06 Jul 2011 13:31
by AndreyZ
Please send a script to create your stored procedure to andreyz*devart*com.

Posted: Wed 06 Jul 2011 20:31
by TEMRUS
Subj problem error has been resolved when I've removed an inbound parameter with GUID datatype.

Posted: Thu 07 Jul 2011 07:23
by AndreyZ
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;

Posted: Thu 07 Jul 2011 12:01
by TEMRUS
Problem solved this way. Thanx all.