简体   繁体   English

在C ++程序中连接Access数据库时出错

[英]error in connecting access database in c++ program

i am getting error "security issue : the connection string may contain a password" 我收到错误消息“安全性问题:连接字符串可能包含密码”

i want to connect access database with my c++ program using ODBC. 我想使用ODBC将Access数据库连接到我的C ++程序。 i am using visual studio 2008. 我正在使用Visual Studio 2008。

following are the steps what i have done to create this created simple access database (testdb.mdb) and added user dsn(test) then created mfc application in database support i selected database view with file support and selected odbc and cliked button data source and selected my created dsn(test) 以下是我创建此简单访问数据库(testdb.mdb)并添加用户dsn(test)的步骤,然后在数据库支持中创建了mfc应用程序。我选择了具有文件支持的数据库视图,并选择了odbc和cliked按钮数据源,选择了我创建的dsn(测试)

now when i build this that above error occurs what shoul i do ? 现在当我建立这个上面的错误发生我该怎么办?

just remove the line 只需删除行

#error Security Issue: The connection string may contain a password

from the generated header file. 从生成的头文件。

it is there just to make you aware of that it is not good to have hardcoded passwords in your code. 只是为了使您意识到在代码中包含硬编码的密码是不好的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM