Announcement

Collapse
No announcement yet.

Reading values from homeser.mdb

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Reading values from homeser.mdb

    I would like to make a vb script for reading some temp values from the homeseer.mdb for calculating the daily average temperatures. I wonder whether anyone has a script which reads data from the database. Thanks.

    Jari

    #2
    There have been many examples over the years. The basic approach that I use is to use ADODB which provides a mechanism to establish a connection to the database and execute SQL commands to identify what data is of interest. .NET has an equivalent to ADODB for .vb scripts. I can recall two scripts I put in the script several years ago. Logit stores data to a database. The movies script stores andqueries to/from the database.. I know there are other more recent exaples.

    Comment


      #3
      Mike,

      I can establish a connection to the database but I don't know how to execute a SQL command to query data from the database. I am trying to read temp values using code in my vb-script.:

      SQL1 = "SELECT CDate(SampleDate),"& tempLocation(0) &" FROM Temperature WHERE CDate(SampleDate) > " &CDate(StartDTime)& " AND CDate(SampleDate) < " &CDate(StopDTime)& " ORDER BY CDate(SampleDate) ASC"

      where StartDTime is the first time value for previous day and StopDTime the last one. TempLocation(0) is that temp value I want to read from the database.

      I wonder whether the syntax is totally wrong.
      Last edited by jlikonen; February 14, 2009, 11:18 AM.

      Comment


        #4
        OK, now I have figured out what was the problem. Reading from the database was not OK, as I tried to manipulate a field without converting it to a value.

        Jari

        Comment

        Working...
        X