添加数据库配置项 - SetDbConfig
函数简介
保存用户自定义数据到数据库。
接口名称
SetDbConfig
DLL调用
int SetDbConfig(long ola, long db, string key, string value);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| db | 长整数型 | 数据库对象指针,由 OpenDatabase 接口返回。 |
| key | 字符串 | 配置项名,如"width"、"height"。 |
| value | 字符串 | 配置项值,如"100"。 |
示例
# 设置数据库配置
key = "cache_size"
value = "1000"
result = OLAServer.SetDbConfig(db, key, value)
if result == 1:
print("数据库配置设置成功。")
else:
print("数据库配置设置失败。")
返回值
整数型:1 成功,0 失败。
注意事项
- 该函数用于设置用户自定义数据,如账号密码、软件默认配置等信息。
