How to access the same database file between two projects in a Visual Studio Solution?

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 18:58
Joined
Mar 22, 2009
Messages
1,019
ProjectA: C# class library project
ProjectB: .Net MAUI Blazor Hybrid project
 
If the database to be shared is a more or less standard DB, either .MDB or .ACCDB, and is a proper back-end file with no code that you would need to invoke, you should be able to access it using your system's DAO reference library files. For instance, on my system that uses Office 2021, I would probably try to reference the Microsoft DAO 3.6 library. The version number might change depending on Office version.
 
Sorry Doc. Now only I searched about accdb and visual studio. We cannot migrate accdbs using Entity Framework Core. so now my question is: "How to use an sqlite3 database file between two projects inside a visual studio solution". Now it has become a complete "Other Software". Thanks Doc.
 
Jet/ACE are ODBC compliant. To get data from an .mdb or .accdb, your code needs to use ODBC to make proper connections. I think DAO is only used within VBA. You probably need to use ADO.
 
Jet/ACE are ODBC compliant. To get data from an .mdb or .accdb, your code needs to use ODBC to make proper connections. I think DAO is only used within VBA. You probably need to use ADO.
The problem is building the connection string. Where the database file (any database file) would be residing after deployment and How to access the exact same file... is where the problem is.
 
The problem is building the connection string. Where the database file (any database file) would be residing after deployment and How to access the exact same file... is where the problem is.
If you don't know where the database is then that is a problem. Do they move around? Because if they don't then you can have a setup procedure that locates the database so that the app can build the correct connection string.
 
If you don't know where the database is then that is a problem. Do they move around? Because if they don't then you can have a setup procedure that locates the database so that the app can build the correct connection string.
You know... In MAUI. The target machine may be an Android or an Iphone or a PC. PC has drives and what about other devices...
 
I don't know anything about MAUI but .accdb's don't work on an Android or an iPhone.
 
Files are files. They're just buckets of bits. Using a file is different and these .accdb's are to be used to provide data.
 
So, you think that using ODBC, you could actually retrieve data from an .accdb on an Android/iPhone? Not sure what an .accdb would be doing on a phone but I'll play your silly game.
 
It's not my game
And it's not stupid at all
Especially because it responds to a request from colleague prabha_friend
Of course, if you have a simpler solution, or less stupid, that's fine, let's hear it.
 
What is your problem @amorsik ? If you have a solution that uses .accdb 's on phones, let us know what it is. I'm pretty sure @prabha_friend is looking to do the opposite. I think he wants the phones to get data from the database on a server. But only the OP can tell us the details.
 
I, on the other hand, read what our colleague writes, and if possible I try to help him
You're being pretty aggressive and downright nasty. Get a grip. Take a deep breath and allow our colleague to chime in. It's probably sleepytime for him now.
 
I don't think proposing a solution, even if you said there isn't one, can be considered aggressive
Don't worry about breathing, I do the ones I like: deep, short, long, a bit of everything.
 
I don't think proposing a solution, even if you said there isn't one,
And yet you refused to elaborate on exactly how one would be able to get data from an .accdb on a phone when asked. If you think that is the solution our friend is looking for then, what's the big deal? Share it with us while the OP sleeps.
 

Users who are viewing this thread

Back
Top Bottom