i have a vb6 application that i am using DAO to create a connection to a database and trying to open a recordset. the database is a foxpro database and i have refernece to Microsoft DAO 2.5/3.5 Compatibility Library.
my code is as follows
Dim gdbSMS As Database
If gdbSMS Is Nothing Then
Set gdbSMS = OpenDatabase("C:\Work\M2M Test\DATA", False, False, "Foxpro 2.6;")
End If
Dim sql As String
sql = "select *, substr(lineitem,8,6) as aa from shippers where shipper = '001322' order by aa"
Dim rsShipper As DAO.Recordset
Set rsShipper = gdbSMS.OpenRecordset(sql)
Do While Not rsShipper.EOF
Beep
rsShipper.MoveNext
Loop
rsShipper.Close
when i execute teh line for openrecordset i get an error "undefinied function 'substr' in expression i run the exact same query in foxpro and it works fine. any thoughts on what i need to do to get this to work with substring functions? thanks