Results 1 to 2 of 2
  1. #1

    Default undefined function 'substr' in expression in vb6


    Guys unsa problema ani

    Run time error '-2147217900(80040e14)':
    undefined function 'substr' in expression in vb6

    mS access ako gamit.

    here is the code:
    Function GetLastLevel(StudID As String, SY As String) As Integer
    Dim rs As New ADODB.Recordset

    Set rs = New ADODB.Recordset

    rs.Open "SELECT YearLevel FROM tblEnrollment INNER JOIN tblLevel ON tblLevel.LevelID=tblEnrollment.LevelID WHERE StudentID='" & StudID & "' AND SUBSTR(SchoolYear,1,4)<'" & SY & "' ORDER BY EnrollID DESC", cn, adOpenDynamic, adLockOptimistic
    If Not rs.EOF Then
    GetLastLevel = rs!YearLevel
    Else
    GetLastLevel = 0
    End If
    rs.Close

    End Function

    hope to hhave a response here.
    ty

  2. #2

    Default Re: undefined function 'substr' in expression in vb6

    Quote Originally Posted by reyarita View Post
    Guys unsa problema ani

    Run time error '-2147217900(80040e14)':
    undefined function 'substr' in expression in vb6

    mS access ako gamit.

    here is the code:
    Function GetLastLevel(StudID As String, SY As String) As Integer
    Dim rs As New ADODB.Recordset

    Set rs = New ADODB.Recordset

    rs.Open "SELECT YearLevel FROM tblEnrollment INNER JOIN tblLevel ON tblLevel.LevelID=tblEnrollment.LevelID WHERE StudentID='" & StudID & "' AND SUBSTR(SchoolYear,1,4)<'" & SY & "' ORDER BY EnrollID DESC", cn, adOpenDynamic, adLockOptimistic
    If Not rs.EOF Then
    GetLastLevel = rs!YearLevel
    Else
    GetLastLevel = 0
    End If
    rs.Close

    End Function

    hope to hhave a response here.
    ty
    Use Mid() function. If you have the time, also spend some of it learning ADODB.Command & Parameters to clean up and secure your literal SQL.

  3.    Advertisement

Similar Threads

 
  1. Xend Express in Cebu
    By travelearner in forum Business, Finance & Economics Discussions
    Replies: 2
    Last Post: 08-31-2017, 01:15 AM
  2. love can be expressed in various ways
    By Meganda in forum "Love is..."
    Replies: 6
    Last Post: 08-27-2012, 04:53 AM
  3. American Express in Cebu
    By joan624 in forum Business, Finance & Economics Discussions
    Replies: 0
    Last Post: 05-29-2010, 09:48 PM
  4. Need help in MSACCESS using VB6
    By Kazekage in forum Programming
    Replies: 3
    Last Post: 10-11-2009, 10:51 AM
  5. Top 10 Most Irritating Pinoy Expressions (in English)
    By Motownkid in forum Arts & Literature
    Replies: 74
    Last Post: 05-17-2009, 03:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top