Hi,
I want to use RDS for my applications to provide data access to remote SQL
Server 2000 database. Everything works just fine, but I have encountered
some
problems that I cannot resolve:
So I have stored procedure that looks like this:
CREATE PROCEDURE TestInputOutput
@[EMAIL PROTECTED]
int out,
@[EMAIL PROTECTED]
int out,
@[EMAIL PROTECTED]
int
AS
SELECT @[EMAIL PROTECTED]
= 2
SELECT @[EMAIL PROTECTED]
= 3
return
And a simple programm code written on C#:
ADODB.Connection cn = new ADODB.ConnectionClass();
cn.Open("Provider=MS Remote;Remote
Server=http://server;Handler=MSDFMAP.Handler;Data
Source=MyPubsConn",
null,
null, 0);
//cn.Open("Provider=SQLOLEDB.1;Data Source=(local);Initial
Catalog=catalog;User ID=user;Password=password", null, null, 0);
ADODB.Command com = new ADODB.CommandClass();
com.CommandType = ADODB.CommandTypeEnum.adCmdText;
com.CommandText = "exec TestInputOutput ? out, ? out, ?";
com.ActiveConnection = cn;
ADODB.Parameter par = new ADODB.ParameterClass();
par = com.CreateParameter("@[EMAIL PROTECTED]
",
ADODB.DataTypeEnum.adInteger,
ADODB.ParameterDirectionEnum.adParamInputOutput, 4, 330);
com.Parameters.Append(par);
par = com.CreateParameter("@[EMAIL PROTECTED]
",
ADODB.DataTypeEnum.adInteger,
ADODB.ParameterDirectionEnum.adParamInputOutput, 4, 1);
com.Parameters.Append(par);
par = com.CreateParameter("@[EMAIL PROTECTED]
",
ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamInput,
4,
DBNull.Value);
com.Parameters.Append(par);
object recAffected = Type.Missing;
object pars = new object[3] { 330, 1, 1 };
com.Execute(out recAffected, ref recAffected, 0);
cn.Close();
1. When I try to use InputOutput or Output Parameter when executing stored
procedure - MS REMOTE returns me "an unexpected error". With Input
Parameters
everything works OK and if I use that commented connection string it works
fine also. So, does RDS sup****ts Output Parameters?
2. if I supply DBNull.Value as a value of any parameter I get an error
"Procedure 'TestInputOutput' expects parameter '@[EMAIL PROTECTED]
', which was not
supplied." Of course with native SQLOLEDB Provider everything works fine.
I
think that it must sup****t null values for the parameter. Of course I can
avoid this problem by setting default values for parameters in stored
procedure, but it's not what I want to do really.
3. this one is not critical, but MS REMOTE returns "an unexpected error"
if
you try to set parameter's Attribute value to
AdoEnums.ParameterAttributes.LONG for binary data parameter.
So I want to know can it be fixed, or may be I'm doing something wrong
with
it.
I'm looking forward to hearing from you.
Fergard


|