Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 6th, 2008, 06:52 PM
Registered User
 
Join Date: Oct 2008
Location: Union City, Ca, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect using MYOB ODBC driver mat41 Classic ASP Professional 0 August 7th, 2008 12:56 AM
ODBC driver creation densam ADO.NET 0 January 4th, 2006 06:00 AM
SQL ODBC Driver Pragnesh1205 SQL Server 2000 6 October 31st, 2005 01:15 PM
Rdb ODBC Driver Eron Oracle 0 March 9th, 2005 04:32 AM
ODBC driver for Teradata clueless_may Access VBA 0 November 1st, 2004 11:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.