当前位置:网站首页>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;
}

边栏推荐
- Rendering engine development
- C accesses mongodb and performs CRUD operations
- codeforces每日5题(均1700)-第三天
- 【NVMe2.0b 14-4】Directive Send/Receive command
- 【NVMe2.0b 14-6】Format NVM、Keep Alive、Lockdown command
- JS中的this指向
- 挖财开户安全吗?怎么有人说不靠谱。
- CUDA implements matrix replication
- Flink sql -- No factory implements ‘org.apache.flink.table.delegation.ExecutorFactory‘.
- CUDA realizes L2 European distance
猜你喜欢

Gilbert Strang's course notes on linear algebra - Lesson 2

Axure制作菜单栏效果

el-input 限制只能输数字
![[untitled]](/img/b8/e3f54fe5d1079663799887e62cb07c.jpg)
[untitled]

Redis design and Implementation (II) | database (deletion strategy & expiration elimination strategy)

【NVMe2.0b 14-1】Abort、Asynchronous Event Request、Capacity Management command

Redis design and Implementation (V) | sentinel sentry

Gilbert Strang's course notes on linear algebra - Lesson 1

Redis设计与实现(六)| 集群(分片)

【NVMe2.0b 14】NVMe Admin Command Set
随机推荐
Redis design and Implementation (I) | data structure & object
【NVMe2.0b 14-4】Directive Send/Receive command
Mmcv expanding CUDA operator beginner level chapter
2021-02-27
Unity 基础光照模型
QT event cycle
Emoji icons supported by markdown
Introduction to MySQL foundation power node [Lao Du] class assignment
【NVMe2.0b 14-3】Doorbell Buffer Config command、Device Self-test command
【NVMe2.0b 14-7】Set Features(上篇)
Summary of common pytoch APIs
[untitled]
【NVMe2.0b 14-2】Create/Delete Queue
CUDA realizes L2 European distance
mysql基础入门 day3 动力节点[老杜]课堂笔记
Redis design and Implementation (VI) | cluster (sharding)
【NVMe2.0b 14】NVMe Admin Command Set
This point in JS
Redis设计与实现(四)| 主从复制
Qt连接神通数据库