Re: VBA EXCEL DBASE SQL
From: Cindy Winegarden (cindy_winegarden_at_msn.com)
Date: 12/20/04
- Previous message: Ashok K Kumar: "Re: ADO Parameters error"
- In reply to: Bill Wilkie: "VBA EXCEL DBASE SQL"
- Next in thread: Greg Schretter: "Re: VBA EXCEL DBASE SQL"
- Reply: Greg Schretter: "Re: VBA EXCEL DBASE SQL"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 20 Dec 2004 15:36:02 -0500
Hi Bill,
I'm not sure about Dbase but in FoxPro dates are written in text surrounded
by curly braces: {12/20/2004}.
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com
"Bill Wilkie" <bwilkie@sbcglobal.net> wrote in message
news:%236wZkWI5EHA.3648@TK2MSFTNGP11.phx.gbl...
> Using WinXPsp2 and OfficeXP Excel. Trying to get data from huge dbase
> dbf's.
> ----------------------------------------------------------------------------
> -----
> Rem Microsoft ActiveX Data Objects 2.8 in reference selected
> Sub test()
> Set MyConn = New ADODB.Connection
> MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=e:\databases;Extended Properties=dbase IV"
> MyConn.Open
>
> Rem do sql statement to load MyRecSet
> Rem Set MyRecSet = MyConn.Execute("SELECT restoid,dates,hours,menuid
> FROM
> payment")
> Rem Set MyRecSet = MyConn.Execute("SELECT restoid,dates,hours,menuid
> FROM
> payment WHERE payment.dates={20040827}")
>
> Rem copy recordset to ***
> ws.Range("A2").CopyFromRecordset MyRecSet
>
> MyConn.Close
> End Sub
> --------------------------------------------------
> Run with first SELECT with no WHERE command and I get all data.
> Run with second SELECT with WHERE command and get no data. No Errors just
> no
> data.
> The dbf field descripton of the dates field is "Date field formatted as
> CCYYMMDD (8 characters)"
> The CC is century.
>
>
- Previous message: Ashok K Kumar: "Re: ADO Parameters error"
- In reply to: Bill Wilkie: "VBA EXCEL DBASE SQL"
- Next in thread: Greg Schretter: "Re: VBA EXCEL DBASE SQL"
- Reply: Greg Schretter: "Re: VBA EXCEL DBASE SQL"
- Messages sorted by: [ date ] [ thread ]