Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

VB, DLL, Stored Procedure, Format

 
   Database Help (Home) -> Visual Basic RSS
Next:  organizing the tables...  
Author Message
corinne

External


Since: Sep 18, 2003
Posts: 1



(Msg. 1) Posted: Tue Feb 08, 2005 9:40 am
Post subject: VB, DLL, Stored Procedure, Format
Archived from groups: microsoft>public>vb>database (more info?)

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 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
SQL Format - Hi Guys, I am trying to get a selection of fields from a DB. I can select specific records using sql = "SELECT * FROM cds WHERE Artist = 'bryan'" rs.open sql,cn Not problem. But I want to able to retireve records say starting with BR. SO ...

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...

Passing Var's to Procedure - what should I change in the procedure below that I can call it with more variables...(i,e) File2SqlBlob("c:\pic1.jpg","tablename","colname") I am having problem defining the variables within the procedure ..thank you for ...

arrays - is there a way to concatenate the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a datareport for example after 5 records printed. Thank you all
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]