function getting type mismatch 
Author Message
 function getting type mismatch

Hi!

Any ideas why I am getting a type mismatch from this function?

Thank you in advance.

SUB getPDFURL(PDFName)
  SET objFSO=Server.CreateObject("Scripting.FileSystemObject")

  IF (PDFName) THEN
    IF
(objFSO.FileExists(Server.MapPath("https://www.sample.com/protected/pdf/" &
PDFName))) = true Then
      Response.Write(<a href='https://www.sample.com/protected/pdf/" &
PDFName ) & _
      "<IMG>src='/Editpencil.Gif' border='0' alt='Manuals'>" & "</a>"
    ELSE
      Response.Write("&nbsp;")
    END IF
  ELSE
    Response.Write("&nbsp;")
  END IF

  SET objFSO = NOTHING
END SUB

I am trying to replace this VBScript with the aforementioned function:

<a href='https://www.sample.com/protected/pdf/" &
TRIM(oRSCustomers.Fields("UserManuals").Value) & "'>" & "<IMG
src='/Editpencil.Gif' border='0' alt='Manuals'>" & "</a>



Sat, 17 Dec 2005 09:17:50 GMT  
 function getting type mismatch

Quote:

> Hi!

> Any ideas why I am getting a type mismatch from this function?

It's a sub, not a function. There's a big difference.

Quote:

> Thank you in advance.

> SUB getPDFURL(PDFName)
>   SET objFSO=Server.CreateObject("Scripting.FileSystemObject")

>   IF (PDFName) THEN

This line seems strange to me. Later on, you use PDFName as if it contains
the name of a file. The name of a file can neither be true nor false. this
is probably where the type mismatch is coming from.

HTH,
Bob Barrows



Sat, 17 Dec 2005 18:31:19 GMT  
 function getting type mismatch
Hi Bob!

This sub is part of another asp page that I include in another asp page.

I call it like this:

getPDFURL(TRIM(oRSCustomers.Fields("UserManuals").Value))

The reason I am trying to get this to work, is I would rather call the
norecordsfound() than displaying the following error when a manual is not
available:

Directory Listing Denied
This Virtual Directory does not allow contents to be listed.

-or-

Is there a way to call the norecordsfound() in my original code?

<a href='https://www.sample.com/protected/pdf/" &
TRIM(oRSCustomers.Fields("UserManuals").Value) & "'>" & "<IMG
src='/Editpencil.Gif' border='0' alt='Manuals'>" & "</a>

I would greatly appreciate any ideas.

Chuck


Quote:

> > Hi!

> > Any ideas why I am getting a type mismatch from this function?

> It's a sub, not a function. There's a big difference.

> > Thank you in advance.

> > SUB getPDFURL(PDFName)
> >   SET objFSO=Server.CreateObject("Scripting.FileSystemObject")

> >   IF (PDFName) THEN

> This line seems strange to me. Later on, you use PDFName as if it contains
> the name of a file. The name of a file can neither be true nor false. this
> is probably where the type mismatch is coming from.

> HTH,
> Bob Barrows



Sat, 17 Dec 2005 21:22:29 GMT  
 function getting type mismatch
I'm sorry, but I'm lost. You mentioned in the other thread that you no
longer had a problem calling norecordsfound(). Isn't your problem solved?

Bob Barrows

Quote:

> Hi Bob!

> This sub is part of another asp page that I include in another asp
> page.

> I call it like this:

> getPDFURL(TRIM(oRSCustomers.Fields("UserManuals").Value))

> The reason I am trying to get this to work, is I would rather call the
> norecordsfound() than displaying the following error when a manual is
> not available:

> Directory Listing Denied
> This Virtual Directory does not allow contents to be listed.

> -or-

> Is there a way to call the norecordsfound() in my original code?

> <a href='https://www.sample.com/protected/pdf/" &
> TRIM(oRSCustomers.Fields("UserManuals").Value) & "'>" & "<IMG
> src='/Editpencil.Gif' border='0' alt='Manuals'>" & "</a>

> I would greatly appreciate any ideas.

> Chuck




>>> Hi!

>>> Any ideas why I am getting a type mismatch from this function?

>> It's a sub, not a function. There's a big difference.

>>> Thank you in advance.

>>> SUB getPDFURL(PDFName)
>>>   SET objFSO=Server.CreateObject("Scripting.FileSystemObject")

>>>   IF (PDFName) THEN

>> This line seems strange to me. Later on, you use PDFName as if it
>> contains the name of a file. The name of a file can neither be true
>> nor false. this is probably where the type mismatch is coming from.

>> HTH,
>> Bob Barrows



Sat, 17 Dec 2005 21:30:46 GMT  
 function getting type mismatch
Hi Bob!

Sorry for the confusion. The other thread I started was regarding an asp
page that created an excel report accessing a MSSQL table. It works fine
now.

This thread is regarding a sub that I am trying to create to replace the
code that I used once a button was invoked to open the corresponding pdf
manual because if no manual is found I get the aforementioned error. I am
just not sure in this situation where to place the call to the
norecordsfound function.

Is this more clear?

Chuck

Quote:
> I'm sorry, but I'm lost. You mentioned in the other thread that you no
> longer had a problem calling norecordsfound(). Isn't your problem solved?

> Bob Barrows

> > Hi Bob!

> > This sub is part of another asp page that I include in another asp
> > page.

> > I call it like this:

> > getPDFURL(TRIM(oRSCustomers.Fields("UserManuals").Value))

> > The reason I am trying to get this to work, is I would rather call the
> > norecordsfound() than displaying the following error when a manual is
> > not available:

> > Directory Listing Denied
> > This Virtual Directory does not allow contents to be listed.

> > -or-

> > Is there a way to call the norecordsfound() in my original code?

> > <a href='https://www.sample.com/protected/pdf/" &
> > TRIM(oRSCustomers.Fields("UserManuals").Value) & "'>" & "<IMG
> > src='/Editpencil.Gif' border='0' alt='Manuals'>" & "</a>

> > I would greatly appreciate any ideas.

> > Chuck




> >>> Hi!

> >>> Any ideas why I am getting a type mismatch from this function?

> >> It's a sub, not a function. There's a big difference.

> >>> Thank you in advance.

> >>> SUB getPDFURL(PDFName)
> >>>   SET objFSO=Server.CreateObject("Scripting.FileSystemObject")

> >>>   IF (PDFName) THEN

> >> This line seems strange to me. Later on, you use PDFName as if it
> >> contains the name of a file. The name of a file can neither be true
> >> nor false. this is probably where the type mismatch is coming from.

> >> HTH,
> >> Bob Barrows



Sat, 17 Dec 2005 23:14:11 GMT  
 function getting type mismatch
Hi Bob!

I figured it.

Thank you.

Chuck


Quote:
> I'm sorry, but I'm lost. You mentioned in the other thread that you no
> longer had a problem calling norecordsfound(). Isn't your problem solved?

> Bob Barrows

> > Hi Bob!

> > This sub is part of another asp page that I include in another asp
> > page.

> > I call it like this:

> > getPDFURL(TRIM(oRSCustomers.Fields("UserManuals").Value))

> > The reason I am trying to get this to work, is I would rather call the
> > norecordsfound() than displaying the following error when a manual is
> > not available:

> > Directory Listing Denied
> > This Virtual Directory does not allow contents to be listed.

> > -or-

> > Is there a way to call the norecordsfound() in my original code?

> > <a href='https://www.sample.com/protected/pdf/" &
> > TRIM(oRSCustomers.Fields("UserManuals").Value) & "'>" & "<IMG
> > src='/Editpencil.Gif' border='0' alt='Manuals'>" & "</a>

> > I would greatly appreciate any ideas.

> > Chuck




> >>> Hi!

> >>> Any ideas why I am getting a type mismatch from this function?

> >> It's a sub, not a function. There's a big difference.

> >>> Thank you in advance.

> >>> SUB getPDFURL(PDFName)
> >>>   SET objFSO=Server.CreateObject("Scripting.FileSystemObject")

> >>>   IF (PDFName) THEN

> >> This line seems strange to me. Later on, you use PDFName as if it
> >> contains the name of a file. The name of a file can neither be true
> >> nor false. this is probably where the type mismatch is coming from.

> >> HTH,
> >> Bob Barrows



Sun, 18 Dec 2005 04:54:08 GMT  
 function getting type mismatch
Excellent! I was still trying to figure out how to reply ... :-)

Bob

Quote:

> Hi Bob!

> I figured it.

> Thank you.

> Chuck



>> I'm sorry, but I'm lost. You mentioned in the other thread that you
>> no longer had a problem calling norecordsfound(). Isn't your problem
>> solved?

>> Bob Barrows

>>> Hi Bob!

>>> This sub is part of another asp page that I include in another asp
>>> page.

>>> I call it like this:

>>> getPDFURL(TRIM(oRSCustomers.Fields("UserManuals").Value))

>>> The reason I am trying to get this to work, is I would rather call
>>> the norecordsfound() than displaying the following error when a
>>> manual is not available:

>>> Directory Listing Denied
>>> This Virtual Directory does not allow contents to be listed.

>>> -or-

>>> Is there a way to call the norecordsfound() in my original code?

>>> <a href='https://www.sample.com/protected/pdf/" &
>>> TRIM(oRSCustomers.Fields("UserManuals").Value) & "'>" & "<IMG
>>> src='/Editpencil.Gif' border='0' alt='Manuals'>" & "</a>

>>> I would greatly appreciate any ideas.

>>> Chuck




>>>>> Hi!

>>>>> Any ideas why I am getting a type mismatch from this function?

>>>> It's a sub, not a function. There's a big difference.

>>>>> Thank you in advance.

>>>>> SUB getPDFURL(PDFName)
>>>>>   SET objFSO=Server.CreateObject("Scripting.FileSystemObject")

>>>>>   IF (PDFName) THEN

>>>> This line seems strange to me. Later on, you use PDFName as if it
>>>> contains the name of a file. The name of a file can neither be true
>>>> nor false. this is probably where the type mismatch is coming from.

>>>> HTH,
>>>> Bob Barrows



Sun, 18 Dec 2005 04:56:14 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. sql subqueries ok?

2. Passing user data type to function causes type mismatch error

3. Getting a Compile Error: ByRef argument type mismatch

4. Help: Getting Type Mismatch error when OpenRecordSet of new database

5. Getting a type mismatch help?

6. TAPI3: Type Mismatch getting ITBasicCallControl in TE_CALLNOTIFICATION event

7. Backtracking.

8. (no subject)

9. error: type mismatch - when passed prameters into function in asp page

10. Type mismatch on simple boolean function?

11. VBScript with ASP using Len() function gives Type Mismatch error

12. Passing an array to a sub or function I get type mismatch

 

 
Powered by phpBB® Forum Software