Lewis:
Thank you for the info *and* the code.
Dave
On Aug 21, 11:30 pm, Lewis Gardner
<lgard...@[EMAIL PROTECTED]
> wrote:
> Dave wrote:
> > I've been reading some old posts that talk of an inability to connect
> > to an Access database with RB. Is that (still) true? If so, that
> > would be a show stipper for us.
>
> RB connects to Access via ODBC fairly easily. Here is a simple example
> of reading data from a MBD:
>
> Dim db as ODBCDatabase
> db=New ODBCDatabase
> dim curTotal As Currency
>
> db.DataSource= "Driver={Microsoft Access Driver (*.mdb)}; DBQ=my.mdb
"
>
> If db.Connect then
>
> dim rs As RecordSet
> rs = db.SQLSelect("SELECT ID, Amount FROM tblPaymentDetail")
>
> while not rs.EOF
> curTotal = curTotal + rs.Field("Amount").Value
> rs.MoveNext
> wend
>
> EditField1.Text = Format(curTotal, ",###.##")
>
> else
> MsgBox "The connection failed."
> end if


|