Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch error on DLL function in ASP Page

Status
Not open for further replies.

jerjim

Programmer
Jan 4, 2001
85
PH
On an ASP page, when i call a function in an ActiveX component which I created,
I get a type mismatch error. This is the line where that error occurs

sSqlIns = ouSqlIns.HHPev( par1, par2, par3, par4, par5 )

ouSqlIns is a dll component programmed in VB6 and which is instantiated in the ASP page by Server.CreateObject

HHPev is a function which returns a string ( an SQL Insert statement in fact )

par1, par2....etc. are string variables and i displayed their type using the typename function.

When I tested HHPev within a VB6 project, it works fine.
It returns an SQL Insert statement which I then use to update a recordset
using the recordset object's execute command.

But when I call HHPev from an ASP page, it gives me a type mismatch error?
Where is the problem here.?
What variables of different types am I comparing?
They are all strings and I made sure of that!

Can anyone help me on this? Thanks in Advance.

 
ASP script passes ByRef arguments as VARIANTS and expects a VARIANT returned by the function. I've heard that you can cast the arguments to the proper form e.g.
sSqlIns = ouSqlIns.HHPev( Cstr(par1), Cstr(par2), Cstr(par3), Cstr(par4), Cstr(par5 )) but I don't know about the returned value. Try
sSqlIns = CVar(ouSqlIns.HHPev(.....)
It can't hurt.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top