ODBC to text driver
I am using the following code to read records from a SQL 3 table and it works. When using a connection to a text file driver I get an error that I can not use ODBC to import from a Microsoft jet database.
'-------------------------------------------------------------------
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=Agents;")
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
'----------------------------------------------------------------------
thanks
Mike
|