|
-
Feb 3rd, 2015, 12:10 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Unhandled error issues.......or is that manopause?
I am writing an application using visual basic that incorporates an access database. I connected to the database and created a data set. I have used the data source view to drag and drop a field from the dataset onto a form, which creates a binding navigator, table adapter, etc.
When I attempt to run the program I get the following error:
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
Additional information: 'F:\Computer Science\VBA\BuckyTutorials\UrbanGarden\bin\Debug\DataBase
The database is located in F\computer science\vba\buckytutorials\urbangarden\database, not in the path noted above. Just for sh__s and giggles I placed a copy of the database in the path noted above and everything works fine. However, if I just moved the database to that location instead of placing a copy there I get a different error. So what I am trying to figure out is where I can go to correct the path such that it is not looking in the \bin\debug folders for the database. I have looked at the properties for all of the table adapters, binding navitors and anywhere else I can think of and all of the paths are correct. WDF?????
-
Feb 3rd, 2015, 12:30 PM
#2
Re: Unhandled error issues.......or is that manopause?
I'll tell you this, and the majority of people on here would probably agree, but I never use the VS Database Wizard anymore to add my databases. I create all my objects myself and connect to the database myself, that away I know what's going on at all times.
-
Feb 3rd, 2015, 12:56 PM
#3
Re: Unhandled error issues.......or is that manopause?
 Originally Posted by dday9
I'll tell you this, and the majority of people on here would probably agree, but I never use the VS Database Wizard anymore to add my databases. I create all my objects myself and connect to the database myself, that away I know what's going on at all times.
Different strokes for different folks. I use the wizards provided in VS, but I know how to code the objects manually. In my experience, I would say knowing how to use the designer is half the battle as you should know what is going on at all times regardless . I prefer the organization of the queries being inside the XSD file. For queries that the query builder does not support, I will then code queries by hand, but for me this is usually for the exception rather than the rule. I like having all the table adapters and datatables typed and generated for me as I find it makes coding a lot more efficient and faster to get to my end result.
Anyhow OP, your connection is going to be under your application settings. Right-Click the project, select properties, click the settings tab. You should now see a connection string under the application scope. Select the value and then you will see a small box with 3 dots. Click that box to redefine your connection.
-
Feb 3rd, 2015, 12:57 PM
#4
Thread Starter
Fanatic Member
Re: Unhandled error issues.......or is that manopause?
Yeah, I am starting to think that myself. I did notice, after placing a copy of the database in the path noted in the error message that everything works and the database in the error path is the one used. You would think that I could remove the one that I placed where I wanted it, but even though it is not used everything looks for it there.
I guess I will go back to doing it by hand as well. By the way Dday, how do you squish that damned bug on your post?
-
Feb 3rd, 2015, 01:13 PM
#5
Thread Starter
Fanatic Member
Re: Unhandled error issues.......or is that manopause?
I looked in the settings as you suggested, but in the 4th column it shows the intended path instead of the error path. I am unable to find the path noted in the area anywhere in my connections
The first column has the name, the second column has type and the third has scope, which gives me a choice between application and user. The fourth column is value which shows a path and it is correct.
-
Feb 3rd, 2015, 01:42 PM
#6
Re: Unhandled error issues.......or is that manopause?
See what happens using in the new constructor of the form
Code:
AppDomain.CurrentDomain.SetData("DataDirectory", "Your Path to the database")
-
Feb 3rd, 2015, 01:56 PM
#7
Thread Starter
Fanatic Member
Re: Unhandled error issues.......or is that manopause?
I would be happy to do that Kevin, but that seems to be above my pay grade. Where do I find the. "new constructor of the form"? I looked in the form properties, and a couple of other places I could think of, but was unable to find where this code should go.
-
Feb 3rd, 2015, 02:34 PM
#8
Re: Unhandled error issues.......or is that manopause?
It does not exists until you create it but let's try simply doing this before any other code runs for data operations, look at the code placed in form load, place the line above them
-
Feb 3rd, 2015, 02:44 PM
#9
Addicted Member
Re: Unhandled error issues.......or is that manopause?
In some machine sometimes creativa new is stopped to lag phase. Just take a look at MVS schema again. You could find the answer
Sincerely Yours
-
Feb 3rd, 2015, 02:45 PM
#10
Re: Unhandled error issues.......or is that manopause?
gw,
Have you saved the project yet? I get that error if I try to run the debugger and that project is still a temporary project.
-
Feb 3rd, 2015, 03:44 PM
#11
Thread Starter
Fanatic Member
Re: Unhandled error issues.......or is that manopause?
TnTin,
Yes I have. In fact, I have even deleted the project, datasets, etc. and sill come up with the same problem
-
Feb 3rd, 2015, 03:50 PM
#12
Thread Starter
Fanatic Member
Re: Unhandled error issues.......or is that manopause?
Kevin I did what you suggested. I placed the code in the form load just before the call to the table adapter and as soon as I got the path correct was able to open the correct database. Worked like a champ. Thanks a lot.
-
Feb 3rd, 2015, 03:52 PM
#13
Thread Starter
Fanatic Member
Re: Unhandled error issues.......or is that manopause?
One last thing. Could you perhaps explain why this occurs when using data source to get your binding navigator?
I have set these up by just taking a binding navigator from the tools and setting all the properties by hand without ever having this happen.
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
|