Hi Everyone,
Could anyone help me with the following?
I am working from VB6 SP6.
I have created a DLL that makes a few calculation and returns a string
array.
StringArray(0) Example:
D 0 0
0 01 01 2001 0 17 0 24
0 0 0 0 0 0
1 0 0 0 0 0
1 5807463412200 0 0 0 0 --comments: 5807463412200
is of currency type converted to a string and added to the rest of the
string
1 -5807463412200 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 6228235965597 0 0 0 0
1 -6228235965597 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
While testing in the VB6 debugging environement there are no problem. The
results are what I am after.
This DLL is placed on a server with SQL 2000 SP3.
A stored Procedure is creating the the DLL and calling its method (Function
ReturnString(strUnixString As String) As String()); the results above should
be coming back.
That is where I have a problem: the results are now changed to:
D 4 0
0 01 01 2001 0 17 0 24
0 0 0 0 0 0
1 0 0 0 0 0
1 5.807463E+16 0 0 0 0 --comments: 5807463412200 is
transformed into 5.807463E+16 and I don't know why!!!
1 -5.807463E+16 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 6.228236E+16 0 0 0 0
1 -6.228236E+16 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0 0
I do not understand at what level the numbers are being converted and why as
the results are of String() /Varchar(8000) data type
From the VB6 environement the values are correct (Immediate window for
example)
Has anyone got a clue about what is happening?? And how I could solve the
problem?
Let me know if more information are required?
CORINNE
More information:
Stored Procedure content:
CREATE PROCEDURE Create_DLL_Proc
@RequestString varchar(500)
AS
DECLARE @hr int
DECLARE @object int
DECLARE @src varchar(255)
DECLARE @desc varchar(255)
DECLARE @Return varchar(8000)
DECLARE @strUnixString varchar(500)
SET @strUnixString = @RequestString
--Create the object
EXEC @hr = sp_OACreate 'RequestM.RequestCls', @object OUT
--Check for error during the creation of the object
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END
--Call the clsDataTransfer method/class
EXEC @hr = sp_OAMethod @object, 'ReturnString', @Return OUTPUT,
@strUnixString
--Check for error
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object
RETURN
END
--Destroy the object
EXEC @hr = sp_OADestroy @object
--Check for error during the destruction of the object
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object
RETURN
END
>> Stay informed about: VB, DLL, Stored Procedure, Format