COM DLL ACCESSING FROM MSSQL

Hi,

I wrote COM DLL(test.dll)  using VC++ 6 to communicate with WAS.

If i invoke functions  in COM DLL ( test.dll) using Visual Basic application , No issues everything is working fine
if i invoke the same functions in MSSQL using Stored Procedure - not working.

In VB defining variables as String
in SQL defining varibales as Varchar

In COM DLL - function ( BSTR, BSTR , BSTR) - using BSTR and converting them internally char * and working , return type BSTR( converting Back). i am using W2A function to convert BSTR to Char *.

COM DLL is compiled with _MBCS in settings options.

Any Ideas ?

Thanks,
Naren
techref9Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ralf KlattEmployee in Civil ServiceCommented:
Hi,

A year ago I had to call DLL functions from SQL Server ... now it seems that I was at the same point as your question seems to target ... fortunatly the article that helped me is still available ... ;-)

http://www.devarticles.com/c/a/SQL-Server/Extended-Stored-Procedures-Intro-And-10-Cool-Examples/


Best regards,
Raisor
gabesoSolution ArchitectCommented:
Try defining the string parameters as 'nvarchar' rather than 'varchar'.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.