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

边栏推荐
- Pytorch BERT
- Redis设计与实现(七)| 发布 & 订阅
- Sword finger offer II 074 Merge interval (sort, array)
- How can we get a satisfactory salary? These routines still need to be mastered
- Redis设计与实现(八)| 事务
- Flink 数据偶尔数据积压导致checkpoint失败
- Detectron2 source code reading 4-- registrar construction model
- Redis设计与实现(四)| 主从复制
- PHP API to obtain QR code and combine to generate pictures
- Interference source current spectrum test of current probe
猜你喜欢
随机推荐
自制GIF动态图-gifcam
Map,String,Json之間轉換
涂鸦Wi-Fi&BLE SoC开发幻彩灯带
基于Svelte3.x桌面端UI组件库Svelte UI
Emoji icons supported by markdown
Redis设计与实现(八)| 事务
Introduction to MySQL basics day4 power node [Lao Du] class notes
[nvme2.0b 14-7] set features (Part 1)
Gilbert Strang's course notes on linear algebra - Lesson 1
Does the oscilloscope probe affect the measurement of capacitive load?
【NVMe2.0b 14-4】Directive Send/Receive command
Flink SQL custom connector
mysql基础入门 动力节点[老杜]课堂作业
从0开始构建一个瀚高数据库Docker镜像
Sword finger offer II 076 The kth largest number in the array (use heap to solve TOPK problem)
el-input 限制只能输数字
C# ListBox如何获取选中的内容(搜了很多无效的文章)
Markdown支持的emoji图标
云服务器上部署仿牛客网项目
【NVMe2.0b 14-5】Firmware Download/Commit command







