Click to See Complete Forum and Search --> : ASP Search Page (VBScript)


John K.
03-23-2000, 03:43 PM
Hi!

Im letting people search my website. To do this, they type a word in
"txtSearch", which passes itīs value on to "sresult.asp".
Im using the following code in "sresult.asp":

<%
dim Sida()
dim iCount
dim objcls
dim lRet
dim sText
sText = request.querystring("txtSearch")
Set objcls = server.CreateObject("frnucls.functions")
lRet = objcls.sokeftertext("\", sText, cint(icount), Sida()) '<-- Error
occurs on this line
redim sida(0)
set objcls = nothing
response.write icount
%>

(Note: frnucls.functions is a class I've created which does the actual
searching)

But I get this error: "Subscript out of range"

Please help.

Johnny101
03-23-2000, 04:01 PM
It'll be hard to help, since the error is ocurring inside a custom DLL. But
my guess would be that your dll's method can't accept an empty variant as
a subscript. in ASP, as you know, everything is of variant types, so before
you call that method, set iCount = 0 to ensure it has the correct datatype
and see what happens. if your dll is expecting an integer dataytype, type
converting on the way in "CInt(iCount)".

hope some of this helped,

john
please reply to the newsgroup.

"John K." <john.k@home.se> wrote:
>Hi!
>
>Im letting people search my website. To do this, they type a word in
>"txtSearch", which passes itīs value on to "sresult.asp".
>Im using the following code in "sresult.asp":
>
><%
>dim Sida()
>dim iCount
>dim objcls
>dim lRet
>dim sText
>sText = request.querystring("txtSearch")
>Set objcls = server.CreateObject("frnucls.functions")
>lRet = objcls.sokeftertext("\", sText, cint(icount), Sida()) '<-- Error
>occurs on this line
>redim sida(0)
>set objcls = nothing
>response.write icount
>%>
>
>(Note: frnucls.functions is a class I've created which does the actual
>searching)
>
>But I get this error: "Subscript out of range"
>
>Please help.
>
>

John K.
03-23-2000, 09:41 PM
No, thats not it at all. The DLL works fine.
When I copy the code inside my DLL, paste it into a normal EXE-project and
try it inside VBīs IDE, it all works.
The error doesn't occur.

But I think VBScript has a problem with receiving the array from the DLL.
The "Subscript out of range" thing. Non of this happens when I call the DLL
procedure from a VB application.

I am sure that it's VBscript that doesn't handle the Array-thing.
Any thoughts on why this cant be made in VBS?
Any suggestions how to get around this prob?

__________________

"Johnny101" <John@ShallowWaterSystems.NOSPAM.com> wrote in message
news:38da7805$1@news.devx.com...
>
> It'll be hard to help, since the error is ocurring inside a custom DLL.
But
> my guess would be that your dll's method can't accept an empty variant as
> a subscript. in ASP, as you know, everything is of variant types, so
before
> you call that method, set iCount = 0 to ensure it has the correct datatype
> and see what happens. if your dll is expecting an integer dataytype, type
> converting on the way in "CInt(iCount)".
>
> hope some of this helped,
>
> john
> please reply to the newsgroup.
>
> "John K." <john.k@home.se> wrote:
> >Hi!
> >
> >Im letting people search my website. To do this, they type a word in
> >"txtSearch", which passes itīs value on to "sresult.asp".
> >Im using the following code in "sresult.asp":
> >
> ><%
> >dim Sida()
> >dim iCount
> >dim objcls
> >dim lRet
> >dim sText
> >sText = request.querystring("txtSearch")
> >Set objcls = server.CreateObject("frnucls.functions")
> >lRet = objcls.sokeftertext("\", sText, cint(icount), Sida()) '<-- Error
> >occurs on this line
> >redim sida(0)
> >set objcls = nothing
> >response.write icount
> >%>
> >
> >(Note: frnucls.functions is a class I've created which does the actual
> >searching)
> >
> >But I get this error: "Subscript out of range"
> >
> >Please help.
> >
> >
>