If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > error when running query that has a module as a column item

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-29-04, 17:26
rrayfield rrayfield is offline
Registered User
 
Join Date: Dec 2004
Posts: 11
error when running query that has a module as a column item

I am at the endof my rope.

I have a module that runs against a colum value MONTH. this module converts the Month Name to a number
like December = 12 january = 1 so on...........

When running the query in access everything works fine and all the numbers show up. but when I try to call this query from an ASP page it gives an error like this

***********
Microsoft JET Database Engine error '80040e14'
Undefined function 'StrToMonth' in expression.

/members/logon/cc_dis_month.asp, line 122
***********
My ASP code looks like this

************************
<%
sqlrs="SELECT * FROM [Total Customers] WHERE ID = 68 ORDER BY year, total_requests asc"

Dim pPath
vPath = "..\..\fpdb\tree_service_entry.mdb"
pPath = Server.MapPath( vPath )

DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString= "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & pPath & ";" & "JET OLEDBatabase"
objConn.Open

DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open sqlrs, objConn
%>
************************

My module lookd like this

************************
Public Function StrToMonth(strIn As String) As Integer
Dim arrMonth(12) As Variant
Dim i As Integer

arrMonth(0) = "January"
arrMonth(1) = "February"
arrMonth(2) = "March"
arrMonth(3) = "April"
arrMonth(4) = "May"
arrMonth(5) = "June"
arrMonth(6) = "July"
arrMonth(7) = "August"
arrMonth(8) = "September"
arrMonth(9) = "October"
arrMonth(10) = "November"
arrMonth(11) = "December"

For i = 0 To UBound(arrMonth) - 1
If strIn = arrMonth(i) Then
StrToMonth = i + 1
Exit Function
End If
Next i
End Function
************************

To me it looks like when the query is run from ASP it sees that the colum name Expr1 is calling the module StrToMonth and cannot find it? but i thought that would be a built in function of Access..... Is there a way to just make the above module VB an asp inc file to call it locally?

i really don't knowwhat to do and I am stuck at this spot

any help would be greatly appreciated
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On