使用存储在VB中(外部)数据库中的公式 [英] use formulas stored in (external)database within VB

查看:111
本文介绍了使用存储在VB中(外部)数据库中的公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以使用VB中存储在数据库中的公式(访问).
由于公式以文本"形式存储在de数据库中,同时包含字符和数字,因此VB只能识别它作为文本字符串.
该变量不被识别. (2 * y)/e ^ 3"存储在数据库中.
目标是让VB在用户输入变量"y"和"e"并显示输出后计算公式.

可以使用案例选择"并将所有公式存储在程序代码本身中.但是,当您要添加公式时,需要更改程序本身的代码.这不是(最终)用户在运行时的选择.
考虑需要存储的公式数量以及必须定期添加新公式的事实,使用数据库似乎是唯一的方法

欢迎任何输入.

thx.

Is there a way to use formulas stored in a database (access) within VB.
As formulas are stored in de database as "text" while containing caracters and numbers at the same time, VB wil only recognize it as text-string.
Variables in that matter are not recognized.

e.g. "(2 * y) / e ^ 3" is stored in database.
Goal is to have VB calculate the formula after user has input the variables "y" and "e" and present the output.

Working with "case select" and storing all formulas in the program code itself is possible. Nevertheless when you want to add a formula you need to change the code of the program itself. This is not an option for a (end)user during runtime.
Looking at the amount of formulas that need to be stored and the fact that new formula's will have to be added regularly, working with a database seems the only way of doing it.

any input is welcome.

thx.

推荐答案

我不认为VB可以解析一个数学字符串并通过一个简单的函数完成所有转换.

我认为最好的方法是获取计算器程序源代码(应该容易获得),并且简单自己使用计算器代码来解析字符串.
I don't think VB can parse a string of math and do the conversions all in one simple function.

I think the best thing to do, is get a calculator program source code, (which should be easily available), and simple parse the string yourself using the calculator code.


这篇关于使用存储在VB中(外部)数据库中的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆