I am attempting to read records from a csv file using ODBC with the following code:
'-------------------------------------------------------
Public Function ChkAgent(Fname, Lname As String) As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = OpenDatabase("", True, True, Connect:="DSN=Agents2;")
Set rs = dbs.OpenRecordset("select [first name],[last name] from people.csv where ucase([first name]) =ucase('Jessica') and ucase([last name])=ucase('smith');")
ChkAgent = rst.RecordCount
Set rs = Nothing
Set db = Nothing
End Function
'-------------------------------------------------------
I get an error "You can not use ODBC to import records from Microsoft Jet or ISAM database.........."
The code works for a DSN that is a SQL Lite database.
How can I query a csv file using a text drive for ODBC??
Thanks
Mike
'-------------------------------------------------------
Public Function ChkAgent(Fname, Lname As String) As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = OpenDatabase("", True, True, Connect:="DSN=Agents2;")
Set rs = dbs.OpenRecordset("select [first name],[last name] from people.csv where ucase([first name]) =ucase('Jessica') and ucase([last name])=ucase('smith');")
ChkAgent = rst.RecordCount
Set rs = Nothing
Set db = Nothing
End Function
'-------------------------------------------------------
I get an error "You can not use ODBC to import records from Microsoft Jet or ISAM database.........."
The code works for a DSN that is a SQL Lite database.
How can I query a csv file using a text drive for ODBC??
Thanks
Mike