Home > Software engineering >  How to use VB code query access database and interpolation calculation
How to use VB code query access database and interpolation calculation

Time:09-18

I use access to set up a file yst. MDB, which creates a form tb_ys, table row with CO2, N2, H20 composition, columns are respectively 0 degrees, 100 degrees, 200 degrees, 300 degrees of form, click my VB to realize calculation can be calculated after 250 degrees of N2 value, don't know how to write code? Thank you, ask ace to give advice or comments please expert help and
    

CodePudding user response:

What is the row, what call columns? Clarify the problem

CodePudding user response:

Based on rows and columns, you may not know how to interpolation, unless you know the atmospheric composition and the relationship between temperature,

CodePudding user response:

To obtain the temperature, the smaller than 250 should be 200 that row, column and other data
Get the line is larger than 250, should be 300 line, and other column data
And then two lines of the interpolation of data do you need, such as two lines of o2 linear interpolation

If you ask is how to write, SQL,,
Returns a line, temperature greater than 250, according to the temperature ascending order
Returns a line, the temperature is less than 250, according to the temperature descending order

CodePudding user response:

Suggest you add calculation function, jsscript, vbscript function is ok, then, in you to click on the link code to add onclick="your function name"

CodePudding user response:

Before "how to programming" want to give you a piece of paper and a pen you what to do.

CodePudding user response:

The select Max (temperature field) from table where temperature field & lt;=250
The select min (temperature field) from table where temperature field & gt;=250
Through two queries, check the temperature you want between which two temperature value
The rest of the things I guess is pulled out of these two components of temperature data, and then do a linear interpolation,
Such as access to the two temperature T1 and T2, the two temperature of the carbon dioxide concentrations of C1 and C2 respectively now know between T1 and T2 temperature T, want to know after linear interpolation T of co2 concentration C

should be equation(T - T1)/(T2 - T1)=(C - C1)/(C2, C1)
The rest of the things you transpose get C expression, each element in the expression with code to fill in, the conversion can be encapsulated into a function actually, the next you each composition algorithm, can use this function into five arguments,
  • Related