在WinRT中使用SQLite [英] Using SQLite with WinRT

查看:85
本文介绍了在WinRT中使用SQLite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Metro ui应用程序,我想对某些内部数据使用SQLite而不是JET,以便利用一些已经编写的代码.

I am developing a metro ui application and I would like to use SQLite for some internal data instead of JET in order to take advantage of some already-written code.

但是,当我尝试使用sqlite3_open打开数据库时,它不起作用.我收到一条错误消息,提示无法打开数据库.

Howerver when I try to use sqlite3_open for opening a data base, it does not work. I get an error saying a cannot open the data base.

我相信SQLite使用的某些API不能在Metro风格的应用程序上使用.

I believe some APIs used by the SQLite cannot be used on metro style application.

有人可以帮我吗?至少说我如何确定应该移植哪些api?

Can someone help me on this? At least say me how to identify what apis should be ported?

推荐答案

此代码应该有效:

auto localAppDataParh = Windows::Storage::ApplicationData::Current->LocalFolder->Path;
std::wstring path( localAppDataParh->Data() );
path += L"\\sample.db";
sqlite3* db;
int rc = sqlite3_open16( path.c_str(), &db);

我相信SQLite使用的某些API不能在Metro风格的应用程序上使用.

I believe some APIs used by the SQLite cannot be used on metro style application.

可能有效(至少在预览版中有效),但不允许. Windows App Cert Kit说:

might work(at least on Preview Release), but not permitted. Windows App Cert Kit says:


   Error: This application failed the supported API check.
   API CreateFileA in kernel32.dll is not supported for this application type. 
   API CreateFileW in kernel32.dll is not supported for this application type. 
   API DeleteFileA in kernel32.dll is not supported for this application type. 
    :
    :

这篇关于在WinRT中使用SQLite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆