Function works in ASP, but Type Mismatch in VBScript??

Hi Experts,

I have a function that I can get to work fine in ASP, but when I try to call it from a script (vbscript) it doesn't work??
Error is Type Mismatch
If I remove the brackets it gives me Object Expected
If I add "" around the function variable same error

If you could let me know what the problem might be?

Thanks in advance...
<!--#include Virtual="/EUCApps/MoneyMarkets/includes/inc_functions.asp"-->
<!--#include Virtual="/EUCApps/MoneyMarkets/includes/inc_db_MMDesk_connect.asp"-->
<%  
 
response.write "Time Value " & Timevalue(now())
 
response.write "<br>" & Session("UserAccessLevel")
response.write "<br>" & Session("MMDeskAccessLevel")
response.write "<br>" & Session("PersonName")
response.write "<br>" & Session("Initials")
response.write "<br>" & Application("Environ")
'Response.write "<br>" & FormatDate(Now(), 1)
 
response.write "<br><br>" 
 
response.write fListIDtoItem(25)
 
response.write "<br><br>" 
 
response.write fListItemtoID("Confirmed")
 
response.write "<br><br><INPUT type=button value=click onclick=press()>"
 
 
%>
 
<script language="VBScript" type="text/VBScript">
 
'msgbox fListIDtoItem("25")
 
function press()
 
msgbox fListIDtoItem (25)
 
end function
 
</script>
 
 
 
 
'-----------------------------------------------------------------------------------------------------
Function fListIDtoItem(strID)                                                                               
dim strSQLfunc
dim rsGetList                                                                                       
	                                                                                                          
	Set rsGetList = CreateObject("ADODB.Recordset")                                                    
	                                                                                                          
		strSQLfunc = "SELECT vchListItem " & _                                                                      
						 "FROM tblLists " & _                                                                           
						 "WHERE intListItemID=" & strID                                                               
		                                                                                                        
			rsGetList.Open strSQLfunc, objSQLMMDeskConn, 0, 1
		                                                                                                        
			If Not rsGetList.EOF then                                                                             
					fListIDtoItem = rsGetList.Fields("vchListItem").value                                              
			else                                                                                                  
					fListIDtoItem = false                                                                             
			end if                                                                                                
                                                                                                            
End Function

Open in new window

LVL 1
Craig LambieAsked:
Who is Participating?
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.

HuyBDCommented:
sure, the code when you call function is client script, (like javascript)
So you cant call the server script (your function)
Take a look at ajax to solve it
0

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
HuyBDCommented:
0
Craig LambieAuthor Commented:
Thanks so much, missed that entirely...
0
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
VB Script

From novice to tech pro — start learning today.