Home > Software engineering >  Vb to read access content according to the conditions
Vb to read access content according to the conditions

Time:10-07

The access form the path D: \ 1. Name of MDB chsyy
Time date
I want to date in accordance with the time intervals in time for the start to stop the data to MSHFlexGrid. Form a total of 42.

CodePudding user response:

Dim cn As ADODB library. The Connection, the rs As the ADODB library you

Set the cn=New ADODB. Connection
Cn. The Open ". The Provider=Microsoft Jet. The OLEDB. 4.0; The Data Source=D: \ 1. MDB
"Set the rs=New ADODB. You
Rs. Open the "SELECT * FROM chsyy WHERE [date] BETWEEN #" & amp; The Format (start, "yyyy - - dd HH: mm nn: ss") & amp; "# AND #" & amp; The Format (stop, "yyyy - - dd HH: mm nn: ss") & amp; "#", cn

The Set MSHFlexGrid1. The DataSource=rs
  • Related