Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Calculated fields


Message #1 by "Reno" <Reno77@i...> on Tue, 4 Jun 2002 08:41:36
I have a following situation: 
It is a database in Access and in text boxes of the forms are showed 
results of several Access queries. In the queries are calculated fields 
too - for example some query in SQL view:

SELECT [$Time], Lk([$Time]) AS [$Timek], [GN1] FROM Tab1

where Lk is a name of the function that locate in the Access module:
 
Public Function Lk(var)
   Lk=var*2
End Function

Now I want to show this information in Web page:
  
<%
  set conn=Server.CreateObject("ADODB.Connection")
  conn.Open "connname"
  set rs=Server.CreateObject ("ADODB.recordset")
  rs.Open name_of_query, conn
%>

If  this run occurs the error "Undefined function 'Lk' in expression"
but if the function is incorporate in the SQL expression all is ok:

SELECT [$Time], ([$Time])*2 AS [Timek], [GN1] FROM Tab1

However if the expression of function is complicate SQL expression
is such too and this expression of function must write in everyone SQL.

Can I use existent functions or not ? If not ,is then alternative ?
(My environment:  Access + PWS + ASP + VBScript)

Thanks.




  Return to Index