Question : From TQuery to TADOQuery.

Dear Experts,

I have an BCD-example but I want to change it to ADO.
The BCD example contains 1 TDatabase-component
and 6 TQuery-components, named:
1. NeedApptsQuery
2. ApptSchedulesQuery
3. GetApptQuery
4. DeleteApptLinkQuery
5. DeleteApptQuery
6. SchedulesQuery
I want to convert these 6 TQuery-components to TADOQuery-components.

Can someone show me where to fill what in a TADOQuery-component from one
TQuery-component. The other 5 I do it myself.

Thank you in advanced.
Peter Kiers

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
object NeedApptsQuery: TQuery
    DatabaseName = 'UTF'                     <=== this can be ignored
    SQL.Strings = (
      'Select * From GroupLink, GroupAppt'
      '  Where (SchedName = :SchedName)'
      '    And (GroupLink.ApptID = GroupAppt.ApptID)'
      '    And ((StartDate >= :D1) and (EndDate <= :D2))')
    Left = 392
    Top = 560
    ParamData = <
      item
        DataType = ftString
        Name = 'SchedName'
        ParamType = ptUnknown
      end
      item
        DataType = ftDate
        Name = 'D1'
        ParamType = ptUnknown
      end
      item
        DataType = ftDate
        Name = 'D2'
        ParamType = ptUnknown
      end>
  end

Answer : From TQuery to TADOQuery.

1) How to set the column widths on the grid (2 fields)
THISFORM.Grid1.Column1.Width = 20
THISFORM.Grid1.Column2.Width = 30

2) How to get the currently selected row from the grid (just use recno()?)
Yes RECNO() is OK

3) You have to remember _Pageno value in some variable (e.g. _LastPageno) after the first report and print
_pageno + _LastPageno
in the second report

Or switch to VFP 9 which allows NORESET keyword in REPORT FORM command
Random Solutions  
 
programming4us programming4us