|
-
Oct 11th, 2023, 01:59 PM
#1
Thread Starter
Fanatic Member
Lost database
I have been trying to publish an application, but it keeps failing as the process is being run. The project does open up after the error occurs, but I am unable to actually run any of the applications without the error below. Why should there be a database at this location, and what are the settings that are being looked for?
Attachment 188906
There are several things that I can think of to do, but I am a little afraid of doing anything at all, since I will probably make the problem worse, and I do not know why this problem exists at all.
Having said that, there is no database in this location. I checked and while there is a number of similar directories there, this one is not. Why should there be a database located there anyway? I put the database in a specific location (bin/debug) which is where I usually place my databases for applications that I want to publish. In the past this has not been a problem.
It has occurred to me that I might just create that location and put a copy of the database there, but I am guessing I would probably cause other problems.
I wish I could provide a little more detail, but I just don't know what I should even be looking for.
-
Oct 11th, 2023, 03:02 PM
#2
Thread Starter
Fanatic Member
Re: Lost database
Misstatement. I stated that the publish failed. Actually, the Publish was apparently successful. It is when the application starts after the Publish is run and I start the setup.exe
-
Oct 11th, 2023, 03:56 PM
#3
Thread Starter
Fanatic Member
Re: Lost database
I have been looking at this some more and the directory indicated in the message does indeed exist. There is no database in that directory.
It appears to me that I need to place the database in the manifest prior to publishing. Assuming that is correct, I have no idea how to do this.
-
Oct 11th, 2023, 04:09 PM
#4
Re: Lost database
Your attachment isn't valid.
Check all your connection strings and see where they are pointing.
-
Oct 11th, 2023, 06:18 PM
#5
Thread Starter
Fanatic Member
Re: Lost database
I assume you are referring to the connection string found in the project properties. That was set as seen below. Except I can't remember what content exactly was and replaced that with *****. It is one of those things that automatically sets up for you.
Code:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|******|\bin\Debug\MasterBase.accdb
This reminds me of a problem I had quite some time ago that was resolved using what is below. But I do not recall how to set that up or the circumstances.
Code:
AppDomain.CurrentDomain.SetData("DataDirectory","C:\SiTech\Development\SiTechSolution\MasterBase\Bin\Debug\")
What I did do is set the connection string like below. Which is the exact string to the database. Works fine until I run the Setup.
Code:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\SiTech\Development\SiTechSolution\MasterBase (P)\bin\Debug\MasterBase.accdb
Or, are you telling me that in the connection string used in the code should show the full path?
-
Oct 11th, 2023, 07:03 PM
#6
Re: Lost database
 Originally Posted by gwboolean
I assume you are referring to the connection string found in the project properties. That was set as seen below. Except I can't remember what content exactly was and replaced that with *****. It is one of those things that automatically sets up for you.
Code:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|******|\bin\Debug\MasterBase.accdb
This reminds me of a problem I had quite some time ago that was resolved using what is below. But I do not recall how to set that up or the circumstances.
Code:
AppDomain.CurrentDomain.SetData("DataDirectory","C:\SiTech\Development\SiTechSolution\MasterBase\Bin\Debug\")
What I did do is set the connection string like below. Which is the exact string to the database. Works fine until I run the Setup.
Code:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\SiTech\Development\SiTechSolution\MasterBase (P)\bin\Debug\MasterBase.accdb
Or, are you telling me that in the connection string used in the code should show the full path?
Where is your setup.exe installing the application and the database to? If you are installing your application, and database file, to the Program Files folder and your connection string is pointing to a completely different location then obviously the connection string is pointing to the wrong place,
Then again if you are installing your application to the program files folder (as you should) then you shouldn't be also installing your database file there as a normal user wouldn't have permissions to make changes to the database file. You would typically want to put writable files like that into somewhere like Application Data or possibly Documents.
-
Oct 11th, 2023, 09:09 PM
#7
Re: Lost database
Or, are you telling me that in the connection string used in the code should show the full path?
I'm not telling you anything like that. I don't know what the error is that your getting but if it says it can't find the database file in some folder then somewhere in your program your code tells it to look there. I don't know how you have the connection strings setup and after reading your last post I still don't.
-
Oct 11th, 2023, 09:41 PM
#8
Thread Starter
Fanatic Member
Re: Lost database
The only connection strings that I am aware of reside in the project settings. There may well be others, but those are all I know of.
What I was referring to was the connection string(s) found in the Settings of the Project. Until today, I had a single connection string in the project settings. These settings were automatically defined when I connected to database using the Data Connections in the Server Explorer. I then I referred to, what I think is a connection string that I once saw as a resolution to a similar problem. Finally, I showed a string that had a complete path to the database, which is what I would have placed in the settings if I had done it myself.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|