undefined function

Results 1 to 2 of 2

Thread: undefined function

  1. #1
    Join Date
    Dec 1969

    Default undefined function

    Error Type:<BR>Microsoft JET Database Engine (0x80040E14)<BR>Undefined function &#039;IsDue&#039; in expression.<BR><BR>I have seen this error a lot in the forums but have not found the fix for my situation. I have read the MS KB article Q189448 and it says to <BR><BR>"replace the Vbajet32.dll file version with file version that ships with Microsoft Data Access Components (MDAC) version 1.5. "<BR><BR>It doesn&#039;t look like 1.5 is avaiable any more. It also said <BR><BR>"This has been fixed in Visual Basic version 6.0." <BR><BR>Does anyone know what file I download to upgrade to this? I also included the ASP code, SQL of the stored Proceedure, and function in case I messed something up in there.<BR><BR>ASP:<BR>Set oConn371 = Server.CreateObject("ADODB.Connection") <BR>oConn371.Open strConnect<BR>Set cmd = Server.CreateObject("ADODB.Command")<BR>cmd.Active Connection = oConn371<BR>cmd.CommandType = adCmdStoredProc <BR>cmd.CommandText = "qryAutoSchedPM" <BR>cmd.Execute <BR><BR>SQL Fromn stored proceedure:<BR>SELECT tblPM.PMID, tblPM.MEIDKey, tblPM.PMDesc, tblPM.PMRecur, tblPM.PMLastCompleted, IsDue([PMRecur],[PMLastCompleted]) AS IsDue<BR>FROM tblPM;<BR><BR>function:<BR>Public Function IsDue(PMRecur As Integer, PMLastCompleted As Date) As String<BR> On Error Resume Next<BR> Dim strGap<BR> strGap = DateDiff("d", PMLastCompleted, Now)<BR> <BR> If strGap &#062; PMRecur Then<BR> IsDue = "Yes"<BR> Else<BR> IsDue = "No"<BR> End If<BR> <BR>End Function<BR><BR>Thanks<BR>Dale<BR>

  2. #2
    Join Date
    Dec 1969

    Default Don't think you can use...

    ...user defined functions (that work in Access) from SQL queries.<BR><BR>But you don&#039;t need one, really.<BR><BR>Just do:<BR><BR>SELECT PMID, MEIDKey, PMDesc, PMRecur, PMLastCompleted, <BR> IIF( DateDiff(&#039;d&#039;,PMLastCompleted,Now()) &#062; PMRecur, &#039;Yes&#039;, &#039;No&#039; ) AS IsDue<BR>FROM tblPM<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts