Showing posts with label ado. Show all posts
Showing posts with label ado. Show all posts

Wednesday, March 21, 2012

Problems with Oracle character setting

Hi there,

I am using an ADO Oracle Connector to store Oracle data to an SQL Server.
When I map the input data to the OLEDB destination I get the Error msg that
unicode (DT_WSTR) cannot be mapped to 1292 character code (DT_STR).

To solve this I put a Data Conversion Transformation between Source and Destination.
That would mean a lot of work if I couldn't map the data directly from Source to Destination
for all the tables of my project.

I checked the NLS-Settings from the Oracle db:
select * from sys.v_$nls_parameters
NLS_CHARACTERSET -> WE8ISO8859P1

It's really a mystery to me why the DataReader converts Latin-1 to unicode which has to be
converted to Latin-1 again.
Could someone please help me out?

Fridtjof
The problem here is with managed code. The CLR doesn't have a ANSI type string so all strings are converted to Unicode. So in actuality, it is not the datareader that does the conversion but Oracle's ADO.NET connector. Obviously, knowing this doesn't really help you out all that much though. Is there any way you can make the SQL Server table be unicode instead of ANSI. If not then data conversion is the only solution other than to get an OLEDB driver for Oracle, since OLEDB does support ANSI directly.

HTH,
Matt|||Matt,

you're right. I've tried to download Oracle data via OLEDB which nags that it cannot read Oracle's character setting and assumes it to be 1292 (or was it 1252?). But it downloads the data correctly.

Unfortunately I cannot set the password property in a Package configuration. See this post:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=161564&SiteID=1

This way I'm not getting much further. One have to ponder between the different restrictions :(
Thanks anyway
Fridtjof

Problems with null values

I'm reading data with ADO into a recordset. From the recordset, I create an XML string.

Unfortunately, when I go from rst to XML, any null values are chopped off and don't appear in the XML tree. This causes problems in further developments.

It would appear that the easiest way to fix the problem is to guarrantee that there are no nulls in the output data.

I've tried ' ' + tbl.column as NewCol but when tbl.column is null, the result is null also.

suggestions?

For the record, for some damn reason the FOR XML RAW command does not work on my SQL. Don't know why, but I'm trying to find a work around.select coalesce(tbl.column,'') as newcol

replaces null with zero-length string

use 0 for numeric fields, i guess

rudy|||u can check the null value while retreiving the value from a recordset to a variable by iif(isnull(rsAdo("column")),"",rsAdo("column"))|||A variation of r937's answer:

SELECT IsNull(Field, 0) AS Field1
or
SELECT IsNull(Field, 'unknown') AS Field1

Monday, March 12, 2012

Problems with linked server

I have a linked server that is giving consistent errors when I attempt to
define a new view based on it. The error message is:
ADO error: [OLE/DB provider returned message: New transaction cannot enlist
in the specified transaction coordinator.] OLE DB error trace [OLE/DB
Provider 'SQLOLEDB' ITransactionJoi...
Join Transaction returned 0x8004d00a].
The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
The server was set up via sp_addlinkedserver, security is via a dedicated
account added with sp_addlinkedsrvlogin, and the collation compatible and
data access options set via sp_serveroption. Existing views, procedures and
functions work; but if I attempt to modify an object or create a new one, I
get the error above.
The linked server is on a separate domain which trusts the domain from which
it is being linked, but the reverse trust is not set.
Any help would be most appreciated.
Thanks,
JohnJust an update on the problem. I searched the kb and came up with several
topics which looked reasonable, most of which had to do with firewalls. Both
the "servers" have firewalls installed, one is open from within our subnet,
the other is just the Microsoft ICF that shipped with XP (the second server
is my workstation with SQL Developer Edition).
Disabling the firewall fixed the issue, but is not a solution. I have poked
what I hope are the fewest number of holes through it to keep things
working, a small set of ports for DTC and the RPC End Point Mapper. If
anyone has the definitive list of ports that need to be open, I would
appreciate it.
Regards,
John
"John K" <jkraeck@.NOprincetonSPAM.edu> wrote in message
news:eKkXo%23UrDHA.2244@.TK2MSFTNGP12.phx.gbl...
> I have a linked server that is giving consistent errors when I attempt to
> define a new view based on it. The error message is:
> ADO error: [OLE/DB provider returned message: New transaction cannot
enlist
> in the specified transaction coordinator.] OLE DB error trace [OLE/DB
> Provider 'SQLOLEDB' ITransactionJoi...
> Join Transaction returned 0x8004d00a].
> The operation could not be performed because the OLE DB provider
'SQLOLEDB'
> was unable to begin a distributed transaction.
>
> The server was set up via sp_addlinkedserver, security is via a dedicated
> account added with sp_addlinkedsrvlogin, and the collation compatible and
> data access options set via sp_serveroption. Existing views, procedures
and
> functions work; but if I attempt to modify an object or create a new one,
I
> get the error above.
> The linked server is on a separate domain which trusts the domain from
which
> it is being linked, but the reverse trust is not set.
> Any help would be most appreciated.
> Thanks,
> John
>

Friday, March 9, 2012

Problems with disconnected recordsets i Yukon

We have a VB6 application using ADO 2.8 connecting to SQL Server.

We use disconnected recordset to load data to client-side. The client does updates in the recordset and then sends it back to server-side component that converts the recordset into SQL to update the database. No problems in SQL 2000 but on Yukon we get error when trying to update the disconnected recordset on the client.

Error: -2147217887 Multiple-step operation generated errors. Check each status value.

Error only occurs on recordsets which obviously won't work it was a connected recordset; for example a UNION sql.

Is this the way Yukon is supposed to work? Is there anyway to disable this new functionality to really get a disconnected recordset?

One thing that would work is to create a recordset from scratch based on the loaded recordset and copy all data into this new recordset. But it seems like a lot of work doing this each time.

I suspect that Yukon is more accurately reporting that certain columns are not updatable and ADO is marking the disconnected recordset fields as read only. I'll see if there is a way to disable this. One thing you could do to see if this is the case is save the ADO recordset to XML and compare XML from SQL 2000 and Yukon to see what is different.|||

I have a similar problem, did you find any solution to this? I've tried all ADO recordset properties, but I can't find anything.

I saved ADO recordset to XML from SQL 2000 and SQL 2005. There was one difference that is propably the cause. XML from SQL 2005 was missing rs:writeunknown property from attributes. I just don't want to create a recordset first and copy data from original recordset or save the recordset to xml and modify it.

|||Unfortunately I never found any better solution than the one I described.

Problems with disconnected recordsets i Yukon

We have a VB6 application using ADO 2.8 connecting to SQL Server.

We use disconnected recordset to load data to client-side. The client does updates in the recordset and then sends it back to server-side component that converts the recordset into SQL to update the database. No problems in SQL 2000 but on Yukon we get error when trying to update the disconnected recordset on the client.

Error: -2147217887 Multiple-step operation generated errors. Check each status value.

Error only occurs on recordsets which obviously won't work it was a connected recordset; for example a UNION sql.

Is this the way Yukon is supposed to work? Is there anyway to disable this new functionality to really get a disconnected recordset?

One thing that would work is to create a recordset from scratch based on the loaded recordset and copy all data into this new recordset. But it seems like a lot of work doing this each time.

I suspect that Yukon is more accurately reporting that certain columns are not updatable and ADO is marking the disconnected recordset fields as read only. I'll see if there is a way to disable this. One thing you could do to see if this is the case is save the ADO recordset to XML and compare XML from SQL 2000 and Yukon to see what is different.|||

I have a similar problem, did you find any solution to this? I've tried all ADO recordset properties, but I can't find anything.

I saved ADO recordset to XML from SQL 2000 and SQL 2005. There was one difference that is propably the cause. XML from SQL 2005 was missing rs:writeunknown property from attributes. I just don't want to create a recordset first and copy data from original recordset or save the recordset to xml and modify it.

|||Unfortunately I never found any better solution than the one I described.

Problems with disconnected recordsets i Yukon

We have a VB6 application using ADO 2.8 connecting to SQL Server.

We use disconnected recordset to load data to client-side. The client does updates in the recordset and then sends it back to server-side component that converts the recordset into SQL to update the database. No problems in SQL 2000 but on Yukon we get error when trying to update the disconnected recordset on the client.

Error: -2147217887 Multiple-step operation generated errors. Check each status value.

Error only occurs on recordsets which obviously won't work it was a connected recordset; for example a UNION sql.

Is this the way Yukon is supposed to work? Is there anyway to disable this new functionality to really get a disconnected recordset?

One thing that would work is to create a recordset from scratch based on the loaded recordset and copy all data into this new recordset. But it seems like a lot of work doing this each time.

I suspect that Yukon is more accurately reporting that certain columns are not updatable and ADO is marking the disconnected recordset fields as read only. I'll see if there is a way to disable this. One thing you could do to see if this is the case is save the ADO recordset to XML and compare XML from SQL 2000 and Yukon to see what is different.|||

I have a similar problem, did you find any solution to this? I've tried all ADO recordset properties, but I can't find anything.

I saved ADO recordset to XML from SQL 2000 and SQL 2005. There was one difference that is propably the cause. XML from SQL 2005 was missing rs:writeunknown property from attributes. I just don't want to create a recordset first and copy data from original recordset or save the recordset to xml and modify it.

|||Unfortunately I never found any better solution than the one I described.

Wednesday, March 7, 2012

Problems with carating Stored Procedure from ADO

Hi
I try to create SP from ADO. Open connection and excecute queries.
con.Execute "SET QUOTED_IDENTIFIER OFF "
con.Execute "SET ansinull ON"
con.Execute TextProc
TextProc content
"
create procedure BISSGetDllName (
@.ID_MESS numeric(10) = 0,
@.SwiftOperType int = 0,
@.IsAction int=1
) as
Begin
declare
@.ret int,
@.MessageType int,
@.AccBalance1 int,
@.urgency varchar(1)
select
@.MessageType = MessageType
from BISSHead
where ID_MESS = @.ID_MESS
select @.urgency='s'
from BISSMess
where
ID_MESS=@.ID_MESS and
NumOfField='203B' and
convert(int,ContextOfField)=1
if @.MessageType= 202
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='58E')
select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
else
select '_trbis202.dll','TrBIS2202'+@.urgency
return 1
end
else if @.MessageType= 103
begin
declare @.IsTax int
exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
if @.ret<>1
return @.ret
if @.IsTax=1
begin
select '_trbistax.dll','TrBISTax'+@.urgency
return 1
end
/*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
from BISSMessAddition
where ID_MESS = @.ID_MESS
*/
/*if exists(select 1
from ReportSetup
where
Code = 29 and
Amount1=0 and
AccBalance1<>@.AccBalance1
) */
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='57E')
select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
else
select '_trbiss100.dll','TrBIS100'+@.urgency
return 1
end
end
return -1221
end
"
ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specified for
parameter 1.
May bee ADO find parametrs in Create query.. and want values for parametrs.
How could execute this query...
You need to bind to the return parameter.
Michael
"Dmitry" <Savtchin@.st.by> wrote in message
news:OhPrMFaxEHA.3976@.TK2MSFTNGP09.phx.gbl...
> Hi
> I try to create SP from ADO. Open connection and excecute queries.
> con.Execute "SET QUOTED_IDENTIFIER OFF "
> con.Execute "SET ansinull ON"
> con.Execute TextProc
> TextProc content
> "
> create procedure BISSGetDllName (
> @.ID_MESS numeric(10) = 0,
> @.SwiftOperType int = 0,
> @.IsAction int=1
> ) as
> Begin
> declare
> @.ret int,
> @.MessageType int,
> @.AccBalance1 int,
> @.urgency varchar(1)
> select
> @.MessageType = MessageType
> from BISSHead
> where ID_MESS = @.ID_MESS
> select @.urgency='s'
> from BISSMess
> where
> ID_MESS=@.ID_MESS and
> NumOfField='203B' and
> convert(int,ContextOfField)=1
> if @.MessageType= 202
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='58E')
> select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
> else
> select '_trbis202.dll','TrBIS2202'+@.urgency
> return 1
> end
> else if @.MessageType= 103
> begin
> declare @.IsTax int
> exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
> if @.ret<>1
> return @.ret
> if @.IsTax=1
> begin
> select '_trbistax.dll','TrBISTax'+@.urgency
> return 1
> end
> /*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
> from BISSMessAddition
> where ID_MESS = @.ID_MESS
> */
> /*if exists(select 1
> from ReportSetup
> where
> Code = 29 and
> Amount1=0 and
> AccBalance1<>@.AccBalance1
> ) */
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='57E')
> select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
> else
> select '_trbiss100.dll','TrBIS100'+@.urgency
> return 1
> end
>
> end
> return -1221
> end
> "
> ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specified for
> parameter 1.
> May bee ADO find parametrs in Create query.. and want values for
parametrs.
> How could execute this query...
>
>

Problems with carating Stored Procedure from ADO

Hi
I try to create SP from ADO. Open connection and excecute queries.
con.Execute "SET QUOTED_IDENTIFIER OFF "
con.Execute "SET ansinull ON"
con.Execute TextProc
TextProc content
"
create procedure BISSGetDllName (
@.ID_MESS numeric(10) = 0,
@.SwiftOperType int = 0,
@.IsAction int=1
) as
Begin
declare
@.ret int,
@.MessageType int,
@.AccBalance1 int,
@.urgency varchar(1)
select
@.MessageType = MessageType
from BISSHead
where ID_MESS = @.ID_MESS
select @.urgency='s'
from BISSMess
where
ID_MESS=@.ID_MESS and
NumOfField='203B' and
convert(int,ContextOfField)=1
if @.MessageType= 202
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='58E')
select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
else
select '_trbis202.dll','TrBIS2202'+@.urgency
return 1
end
else if @.MessageType= 103
begin
declare @.IsTax int
exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
if @.ret<>1
return @.ret
if @.IsTax=1
begin
select '_trbistax.dll','TrBISTax'+@.urgency
return 1
end
/*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
from BISSMessAddition
where ID_MESS = @.ID_MESS
*/
/*if exists(select 1
from ReportSetup
where
Code = 29 and
Amount1=0 and
AccBalance1<>@.AccBalance1
) */
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='57E')
select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
else
select '_trbiss100.dll','TrBIS100'+@.urgency
return 1
end
end
return -1221
end
"
ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specified
for
parameter 1.
May bee ADO find parametrs in Create query.. and want values for parametrs.
How could execute this query...You need to bind to the return parameter.
Michael
"Dmitry" <Savtchin@.st.by> wrote in message
news:OhPrMFaxEHA.3976@.TK2MSFTNGP09.phx.gbl...
> Hi
> I try to create SP from ADO. Open connection and excecute queries.
> con.Execute "SET QUOTED_IDENTIFIER OFF "
> con.Execute "SET ansinull ON"
> con.Execute TextProc
> TextProc content
> "
> create procedure BISSGetDllName (
> @.ID_MESS numeric(10) = 0,
> @.SwiftOperType int = 0,
> @.IsAction int=1
> ) as
> Begin
> declare
> @.ret int,
> @.MessageType int,
> @.AccBalance1 int,
> @.urgency varchar(1)
> select
> @.MessageType = MessageType
> from BISSHead
> where ID_MESS = @.ID_MESS
> select @.urgency='s'
> from BISSMess
> where
> ID_MESS=@.ID_MESS and
> NumOfField='203B' and
> convert(int,ContextOfField)=1
> if @.MessageType= 202
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='58E')
> select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
> else
> select '_trbis202.dll','TrBIS2202'+@.urgency
> return 1
> end
> else if @.MessageType= 103
> begin
> declare @.IsTax int
> exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
> if @.ret<>1
> return @.ret
> if @.IsTax=1
> begin
> select '_trbistax.dll','TrBISTax'+@.urgency
> return 1
> end
> /*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
> from BISSMessAddition
> where ID_MESS = @.ID_MESS
> */
> /*if exists(select 1
> from ReportSetup
> where
> Code = 29 and
> Amount1=0 and
> AccBalance1<>@.AccBalance1
> ) */
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='57E')
> select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
> else
> select '_trbiss100.dll','TrBIS100'+@.urgency
> return 1
> end
>
> end
> return -1221
> end
> "
> ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specifi
ed for
> parameter 1.
> May bee ADO find parametrs in Create query.. and want values for
parametrs.
> How could execute this query...
>
>

Problems with carating Stored Procedure from ADO

Hi
I try to create SP from ADO. Open connection and excecute queries.
con.Execute "SET QUOTED_IDENTIFIER OFF "
con.Execute "SET ansinull ON"
con.Execute TextProc
TextProc content
"
create procedure BISSGetDllName (
@.ID_MESS numeric(10) = 0,
@.SwiftOperType int = 0,
@.IsAction int=1
) as
Begin
/************************************************** ********
@.ID_MESS - message
@.SwiftOperType - operation
@.IsAction - action or rollback?
************************************************** *******/
declare
@.ret int,
@.MessageType int,
@.AccBalance1 int,
@.urgency varchar(1)
select
@.MessageType = MessageType
from BISSHead
where ID_MESS = @.ID_MESS
select @.urgency='s'
from BISSMess
where
ID_MESS=@.ID_MESS and
NumOfField='203B' and
convert(int,ContextOfField)=1
/*BIS aaieianeee */
if @.MessageType= 202
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='58E')
select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
else
select '_trbis202.dll','TrBIS2202'+@.urgency
return 1
end
else if @.MessageType= 103
begin
/*BIS iaeiae*/
declare @.IsTax int
exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
if @.ret<>1
return @.ret
if @.IsTax=1
begin
select '_trbistax.dll','TrBISTax'+@.urgency
return 1
end
/*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
from BISSMessAddition
where ID_MESS = @.ID_MESS
*/
/*BIS eeeaioneee*/
/*if exists(select 1
from ReportSetup
where
Code = 29 and
Amount1=0 and
AccBalance1<>@.AccBalance1
) */
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='57E')
select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
else
select '_trbiss100.dll','TrBIS100'+@.urgency
return 1
end
end
return -1221
end
"
ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specified for
parameter 1.
May bee ADO find parametrs in Create query.. and want values for parametrs.
How could execute this query...
Please don't multi-post. And stop using a Sybase provider if you're
connecting to SQL Server! http://www.aspfaq.com/2126
"Dmitry" <Savtchin@.st.by> wrote in message
news:u2irvPaxEHA.3096@.TK2MSFTNGP14.phx.gbl...
> Hi
> I try to create SP from ADO. Open connection and excecute queries.
> con.Execute "SET QUOTED_IDENTIFIER OFF "
> con.Execute "SET ansinull ON"
> con.Execute TextProc
> TextProc content
> "
> create procedure BISSGetDllName (
> @.ID_MESS numeric(10) = 0,
> @.SwiftOperType int = 0,
> @.IsAction int=1
> ) as
> Begin
> /************************************************** ********
> @.ID_MESS - message
> @.SwiftOperType - operation
> @.IsAction - action or rollback?
>
> ************************************************** *******/
> declare
> @.ret int,
> @.MessageType int,
> @.AccBalance1 int,
> @.urgency varchar(1)
> select
> @.MessageType = MessageType
> from BISSHead
> where ID_MESS = @.ID_MESS
> select @.urgency='s'
> from BISSMess
> where
> ID_MESS=@.ID_MESS and
> NumOfField='203B' and
> convert(int,ContextOfField)=1
> /*BIS aaieianeee */
> if @.MessageType= 202
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='58E')
> select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
> else
> select '_trbis202.dll','TrBIS2202'+@.urgency
> return 1
> end
> else if @.MessageType= 103
> begin
> /*BIS iaeiae*/
> declare @.IsTax int
> exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
> if @.ret<>1
> return @.ret
> if @.IsTax=1
> begin
> select '_trbistax.dll','TrBISTax'+@.urgency
> return 1
> end
> /*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
> from BISSMessAddition
> where ID_MESS = @.ID_MESS
> */
> /*BIS eeeaioneee*/
> /*if exists(select 1
> from ReportSetup
> where
> Code = 29 and
> Amount1=0 and
> AccBalance1<>@.AccBalance1
> ) */
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='57E')
> select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
> else
> select '_trbiss100.dll','TrBIS100'+@.urgency
> return 1
> end
>
> end
> return -1221
> end
> "
> ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specified for
> parameter 1.
> May bee ADO find parametrs in Create query.. and want values for
parametrs.
> How could execute this query...
>

Problems with carating Stored Procedure from ADO

Hi
I try to create SP from ADO. Open connection and excecute queries.
con.Execute "SET QUOTED_IDENTIFIER OFF "
con.Execute "SET ansinull ON"
con.Execute TextProc
TextProc content
"
create procedure BISSGetDllName (
@.ID_MESS numeric(10) = 0,
@.SwiftOperType int = 0,
@.IsAction int=1
) as
Begin
/ ****************************************
******************
@.ID_MESS - message
@.SwiftOperType - operation
@.IsAction - action or rollback?
****************************************
*****************/
declare
@.ret int,
@.MessageType int,
@.AccBalance1 int,
@.urgency varchar(1)
select
@.MessageType = MessageType
from BISSHead
where ID_MESS = @.ID_MESS
select @.urgency='s'
from BISSMess
where
ID_MESS=@.ID_MESS and
NumOfField='203B' and
convert(int,ContextOfField)=1
/*BIS aaieianeee */
if @.MessageType= 202
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='58E')
select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
else
select '_trbis202.dll','TrBIS2202'+@.urgency
return 1
end
else if @.MessageType= 103
begin
/*BIS iaeiae*/
declare @.IsTax int
exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
if @.ret<>1
return @.ret
if @.IsTax=1
begin
select '_trbistax.dll','TrBISTax'+@.urgency
return 1
end
/*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
from BISSMessAddition
where ID_MESS = @.ID_MESS
*/
/*BIS eeeaioneee*/
/*if exists(select 1
from ReportSetup
where
Code = 29 and
Amount1=0 and
AccBalance1<>@.AccBalance1
) */
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='57E')
select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
else
select '_trbiss100.dll','TrBIS100'+@.urgency
return 1
end
end
return -1221
end
"
ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specified
for
parameter 1.
May bee ADO find parametrs in Create query.. and want values for parametrs.
How could execute this query...Please don't multi-post. And stop using a Sybase provider if you're
connecting to SQL Server! http://www.aspfaq.com/2126
"Dmitry" <Savtchin@.st.by> wrote in message
news:u2irvPaxEHA.3096@.TK2MSFTNGP14.phx.gbl...
> Hi
> I try to create SP from ADO. Open connection and excecute queries.
> con.Execute "SET QUOTED_IDENTIFIER OFF "
> con.Execute "SET ansinull ON"
> con.Execute TextProc
> TextProc content
> "
> create procedure BISSGetDllName (
> @.ID_MESS numeric(10) = 0,
> @.SwiftOperType int = 0,
> @.IsAction int=1
> ) as
> Begin
> / ****************************************
******************
> @.ID_MESS - message
> @.SwiftOperType - operation
> @.IsAction - action or rollback?
>
> ****************************************
*****************/
> declare
> @.ret int,
> @.MessageType int,
> @.AccBalance1 int,
> @.urgency varchar(1)
> select
> @.MessageType = MessageType
> from BISSHead
> where ID_MESS = @.ID_MESS
> select @.urgency='s'
> from BISSMess
> where
> ID_MESS=@.ID_MESS and
> NumOfField='203B' and
> convert(int,ContextOfField)=1
> /*BIS aaieianeee */
> if @.MessageType= 202
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='58E')
> select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
> else
> select '_trbis202.dll','TrBIS2202'+@.urgency
> return 1
> end
> else if @.MessageType= 103
> begin
> /*BIS iaeiae*/
> declare @.IsTax int
> exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
> if @.ret<>1
> return @.ret
> if @.IsTax=1
> begin
> select '_trbistax.dll','TrBISTax'+@.urgency
> return 1
> end
> /*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
> from BISSMessAddition
> where ID_MESS = @.ID_MESS
> */
> /*BIS eeeaioneee*/
> /*if exists(select 1
> from ReportSetup
> where
> Code = 29 and
> Amount1=0 and
> AccBalance1<>@.AccBalance1
> ) */
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='57E')
> select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
> else
> select '_trbiss100.dll','TrBIS100'+@.urgency
> return 1
> end
>
> end
> return -1221
> end
> "
> ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specifi
ed for
> parameter 1.
> May bee ADO find parametrs in Create query.. and want values for
parametrs.
> How could execute this query...
>

Problems with carating Stored Procedure from ADO

Hi
I try to create SP from ADO. Open connection and excecute queries.
con.Execute "SET QUOTED_IDENTIFIER OFF "
con.Execute "SET ansinull ON"
con.Execute TextProc
TextProc content
"
create procedure BISSGetDllName (
@.ID_MESS numeric(10) = 0,
@.SwiftOperType int = 0,
@.IsAction int=1
) as
Begin
/**********************************************************
@.ID_MESS - message
@.SwiftOperType - operation
@.IsAction - action or rollback?
*********************************************************/
declare
@.ret int,
@.MessageType int,
@.AccBalance1 int,
@.urgency varchar(1)
select
@.MessageType = MessageType
from BISSHead
where ID_MESS = @.ID_MESS
select @.urgency='s'
from BISSMess
where
ID_MESS=@.ID_MESS and
NumOfField='203B' and
convert(int,ContextOfField)=1
/*BIS aaieianeee */
if @.MessageType= 202
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='58E')
select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
else
select '_trbis202.dll','TrBIS2202'+@.urgency
return 1
end
else if @.MessageType= 103
begin
/*BIS iaeiae*/
declare @.IsTax int
exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
if @.ret<>1
return @.ret
if @.IsTax=1
begin
select '_trbistax.dll','TrBISTax'+@.urgency
return 1
end
/*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
from BISSMessAddition
where ID_MESS = @.ID_MESS
*/
/*BIS eeeaioneee*/
/*if exists(select 1
from ReportSetup
where
Code = 29 and
Amount1=0 and
AccBalance1<>@.AccBalance1
) */
begin
if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
NumOfField ='57E')
select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
else
select '_trbiss100.dll','TrBIS100'+@.urgency
return 1
end
end
return -1221
end
"
ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specified for
parameter 1.
May bee ADO find parametrs in Create query.. and want values for parametrs.
How could execute this query...Please don't multi-post. And stop using a Sybase provider if you're
connecting to SQL Server! http://www.aspfaq.com/2126
"Dmitry" <Savtchin@.st.by> wrote in message
news:u2irvPaxEHA.3096@.TK2MSFTNGP14.phx.gbl...
> Hi
> I try to create SP from ADO. Open connection and excecute queries.
> con.Execute "SET QUOTED_IDENTIFIER OFF "
> con.Execute "SET ansinull ON"
> con.Execute TextProc
> TextProc content
> "
> create procedure BISSGetDllName (
> @.ID_MESS numeric(10) = 0,
> @.SwiftOperType int = 0,
> @.IsAction int=1
> ) as
> Begin
> /**********************************************************
> @.ID_MESS - message
> @.SwiftOperType - operation
> @.IsAction - action or rollback?
>
> *********************************************************/
> declare
> @.ret int,
> @.MessageType int,
> @.AccBalance1 int,
> @.urgency varchar(1)
> select
> @.MessageType = MessageType
> from BISSHead
> where ID_MESS = @.ID_MESS
> select @.urgency='s'
> from BISSMess
> where
> ID_MESS=@.ID_MESS and
> NumOfField='203B' and
> convert(int,ContextOfField)=1
> /*BIS aaieianeee */
> if @.MessageType= 202
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='58E')
> select '_trbis202.dll','TrBIS2202'+@.urgency+'NR'
> else
> select '_trbis202.dll','TrBIS2202'+@.urgency
> return 1
> end
> else if @.MessageType= 103
> begin
> /*BIS iaeiae*/
> declare @.IsTax int
> exec @.ret=BISSIsTax @.ID_MESS, @.IsTax output
> if @.ret<>1
> return @.ret
> if @.IsTax=1
> begin
> select '_trbistax.dll','TrBISTax'+@.urgency
> return 1
> end
> /*select @.AccBalance1 = convert(int,substring(KorrAccount,1,4))
> from BISSMessAddition
> where ID_MESS = @.ID_MESS
> */
> /*BIS eeeaioneee*/
> /*if exists(select 1
> from ReportSetup
> where
> Code = 29 and
> Amount1=0 and
> AccBalance1<>@.AccBalance1
> ) */
> begin
> if exists(select 1 from BISSMess where ID_MESS=@.ID_MESS and
> NumOfField ='57E')
> select '_trbiss100.dll','TrBIS100'+@.urgency+'NR'
> else
> select '_trbiss100.dll','TrBIS100'+@.urgency
> return 1
> end
>
> end
> return -1221
> end
> "
> ADO sad [SYBASE][OLE DB Sybase provider]Value has not been specified for
> parameter 1.
> May bee ADO find parametrs in Create query.. and want values for
parametrs.
> How could execute this query...
>