24,860
社区成员




#include "stdafx.h"
#include "stdlib.h"
extern "C"{
#include "./sqlite3.h"
}
#pragma comment(lib,"../lib/sqlite3.lib")
int _tmain(int argc, _TCHAR* argv[])
{
sqlite3 * db = NULL;
char * errmsg = NULL;
char * sql;
int result;
/*打开数据库,若无则创建之*/
result = sqlite3_open("../Data/MSTR.db", &db);
if(result != SQLITE_OK){
printf("数据库连接失败...");
system("pause");
return -1;
}
/* 创建各种数据表*/
sqlite3_close(db);
return 0;
}
#include "stdafx.h"
#include "stdlib.h"
extern "C"{
#include "./sqlite3.h"
}
#pragma comment(lib, "../lib/sqlite3.lib")
using namespace 系统设置;
void test();
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
//连接数据库
test();
// 在创建任何控件之前启用 Windows XP 可视化效果
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// 创建Login窗口并运行它
Application::Run(gcnew Login());
return 0;
}
void test(){
sqlite3 * db = NULL;
sqlite3_open("../Data/MSTR.db", &db);
/* 建表 或 查询 */
}