I am building a web application based on an Access database. One of the reports I need to port to ASP is based
on a query that includes a function that is stored in a module within the Access database. The function removes
the numbers from the address field so that this field can be sorted by street name.
The SQL statement is my asp page is as follows:
sql = "SELECT DISTINCTROW qryLastVisitDate.ShopName, qryLastVisitDate.ShopCity,
qryLastVisitDate.ShopAddress, qryLastVisitDate.ShopContact1FirstName, qryLastVisitDate.LastOfVisitDate "
sql = sql & "FROM tblVisits, qryLastVisitDate "
sql = sql & "ORDER BY getNoNums([ShopAddress]);"
The function in the Access module is as follows:
Public Function getNoNums(addr As String) As String
Dim i As Integer, t As String
addr = Trim(addr)
If Len(addr) Then
For i = 1 To Len(addr)
t = Mid(addr, i, 1)
If Asc(t) > 57 Or Asc(t) < 48 Then getNoNums = getNoNums & t
Next i
Else
getNoNums = ""
End If
End Function
When I copied the function into my asp page, of course there were errors. Can anybody help me to make this
code work in asp?
Thank you very much!