当前位置:网站首页>QT connection to Shentong database
QT connection to Shentong database
2022-06-30 08:39:00 【Emilia sugar】
1. First go to the official website of Shentong database to download " Shentong database " System .

2. After downloading, there is a " Shentong database - Database quick start .pdf" Operation document of .

3. Install according to the operating documentation .

4. After installation, check whether the service of Shentong database is started , If it is not started, please start it manually .

5. Can pass odbc Data source function view the installed Shentong database driver .

6. After installation, there will be a... In the program directory " Shentong database - Database development manual "

7. We find " Use SQLDriverConnect Connect " , There are other ways to connect , Please check the details by yourself .

8.Qt The connection code is as follows :
QSqlDatabase KQProduct::getQSqlDatabaseConn()
{
QSqlDatabase database = QSqlDatabase::database("KqMobileExChange"); // Connection name
if(database.isOpen())
return database;
database = QSqlDatabase::addDatabase("QODBC","KqMobileExChange");
const QString strName(QString("DRIVER={OSCAR ODBC DRIVER};SERVER=%1;UID=%2;PWD=%3;DATABASE=%4;Port=%5")
.arg(m_sServer) // Service address
.arg(m_sUser) // User name
.arg(m_sPwd) // User password
.arg(m_sDatabase) // Database instance
.arg(m_nPort)); // Port number
database.setDatabaseName(strName);
if (!database.open())
{
QMessageBox::critical(0, QString::fromLocal8Bit(" Database connection error "),database.lastError().text());
}
return database;
}

边栏推荐
- Detectron2 source code reading 2--- using the configurable decorator to build the dataloader
- Gilbert Strang's course notes on linear algebra - Lesson 3
- 快应用中实现自定义抽屉组件
- Pytorch BERT
- How can we get a satisfactory salary? These routines still need to be mastered
- 【NVMe2.0b 14-6】Format NVM、Keep Alive、Lockdown command
- Camera
- Does the oscilloscope probe affect the measurement of capacitive load?
- Unity basic lighting model
- 2021-04-29
猜你喜欢

Axure make menu bar effect

Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush

Summary of common pytoch APIs

快应用中实现自定义抽屉组件

Redis设计与实现(三)| 服务器与客户端的交互(事件IO模型)

Redis design and Implementation (I) | data structure & object

【NVMe2.0b 14-8】Set Features(下篇)

【NVMe2.0b 14-5】Firmware Download/Commit command

C#访问MongoDB并执行CRUD操作

Sword finger offer II 075 Array relative sort (custom sort, count sort)
随机推荐
涂鸦Wi-Fi&BLE SoC开发幻彩灯带
Qqquickpainteditem implements graffiti program drawing board
PHP API to obtain QR code and combine to generate pictures
Redis design and Implementation (VI) | cluster (sharding)
2021-05-06
MIME type Encyclopedia
【付费推广】常见问题合集,推荐榜单FAQ
Interference source current spectrum test of current probe
CUDA implements matrix replication
【NVMe2.0b 14-3】Doorbell Buffer Config command、Device Self-test command
Markdown支持的emoji图标
Summary of common pytoch APIs
Vite project require syntax compatibility problem solving require is not defined
Viteproject require Syntax Compatibility Problem Solving require is not defined
启动jar包报错UnsupportedClassVersionError,如何修复
Conversion between map, string and JSON
How can we get a satisfactory salary? These routines still need to be mastered
Redis设计与实现(八)| 事务
Build a docker image of Henkel database from 0
TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush