SQL database

David Hoffman 121 Reputation points
2021-10-25T20:40:08.473+00:00

I am so frustrated with this that I will start pulling out my hair if I don't find a way to make this work. First off I am no dummy when it comes to SQL databases. I have managed several over the past years, one where I used the SQLite library code in a C++ WPF app and one using MS SQL in a C# app. They worked great and I could find lots of help when I needed it for both, BUT I am getting angry that all my effort leads to dead ends or code failure when I try to use MS SQL, SQL CE, or SQLite3. I am writing my app in UWP C++/WinRT. The app must be written in C++. I find that SQLite only seems to work in UWP C# and C#/CX. I could get the .h files and the code to pass Intellisense, but compile would fail. Something about a missing reference. SQL CE did not work either. I seem to have all the pieces, but it would not compile at all. As far as MS SQL goes, it seems to only work with C# or .NET and not C++. So right now I am dead in the water because I need a database in my app and I cannot find the right information on how to make any one of the 3 work in UWP C++/WinRT. Any help would be appreciated. Also, I really don't care which one I use as long as it works and does not make me walk through a mine field to get it to work. I can also answer any question you have. Thanks.

Universal Windows Platform (UWP)
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,691 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,526 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 81,636 Reputation points
    2021-10-26T15:20:00.35+00:00

    I did a test with SQLite and it seems to work, with "VSIX package for Universal Windows Platform development using Visual Studio 2015"
    from https://sqlite.org/download.html

       // Add reference to "SQLite for Universal Windows Platform"       
       // #include "sqlite3.h"
       // Database in AppX directory
       sqlite3* db = NULL;
       char sDatabaseFile[MAX_PATH] = "SQLite_Test.db";
       int rc = sqlite3_open_v2(sDatabaseFile, &db, SQLITE_OPEN_READWRITE, NULL);
       // rc = SQLITE_OK
    
    2 people found this answer helpful.
    0 comments No comments