-----Original Message-----
From: srini rao [mailto:sraop@e...]
Sent: 09 May 2000 02:28
To: support@w...
Subject: VBscript cannot run accwess Query wit VBA funcion.
To All,
Problem: The VBA functions are not run when invoked thro VBscript in a ASP
file.
Problem Description:
The following is the sample code-in ASP using VBscript:
set cnconnection = server.createobject("adodb.connection")
set rsrecordset = server.createobject("adodb.recordset")
cnconnection.open "dsn=database_Probability"
sqlstatement = "select * from probability "
rsrecordset.open sqlstatement, cnconnection
---
The error occurs on rsrecords.open statement.
---
1. "Probability" is the Access Query defined in the
Access QBE grid.
one of the fileds of this Query is a calculated field shown below:
lease_transactionw: words([lease_transaction])
where words is the function written in VBA, shown below.
---
Function words(lease_Transaction As Boolean) As String
If (lease_Transaction) = 0 Then
words = "sales"
Else
words = "Lease"
End If
---------------------
The ASP code gives error on the rsrecordset.open line.
However if I use,
lease_transactionw: IIf([lease_transaction]=-1,"lease","Sale")
instead of the Words - VBA function
the ASP runs the Query OK.
---I would like to use VBA functions instead of Access
basic like code (IIF etc).
Anyone know the solution.