Gridview in website- Accessdatasource => Cannot use query builder, get error message shown

Posted on 2008-11-10
Medium Priority
Last Modified: 2012-05-05
On my webpage I can drag a gridview object onto the page, and I have to also pull down an AccessDataSource which will bind the gridview to my Access Database assigning the query string and the query and other perameters.

The problem is

(1) If I try to 'configure data source' I cannot browse for my database, all that is shown is the folders within the project (App_Code, App_Data and Bin), which is strange, because I think I remember being able to Browse previously. So, I have to type in the folder and drive by hand. (Although I just read someone else mentioning this somewhere and said that they don't think the browse feature is fully implemented...)

(2) So, that seems ok, but then when I choose 'next' I get to the place where I have to define the query. So, I try to click on the 'query builder' button to bring up the query builder, and I get the error message 'Object reference not set to an instance of the object'.

So, something strange is going on. While the page will run fine, and gas long as the queries are correct the tables will be updated properly, I can't use visual studio functions properly since it doesn't seem to be finding the database? Not sure what is going on here... any help?

Thanks, Aiden
Question by:AidenA
  • 2
LVL 83

Expert Comment

ID: 22928744
Visual Studio expects to have the database within the solution. Right on the project and add the App_Data folder. Then import the database file into this folder and everything should work fine.

Author Comment

ID: 22929231
But I mean, that can't be the case surely? I imagine that there are plenty of applications where the database is not going to be contained within the project?

In fact, everything works fine, I can actually implement everything with the database being held outside of the project. But the problem is that I can't use the querybuilder. So, I imported the file to the project just to see if the querybuilder works, and it is the same problem again.

I came across someone else who seemed to have the exact same problem and that person said:

"I tried everything under the sun to fix this issue. Nothing worked. For an unrelated reason, I upgraded by hard disk and manually installed all of my software (as opposed to transferring the data/applications) in hopes that if something was corrupt; it would not be copied over. That did the trick. I downloaded Visual Web Developer and it now works. I am assuming files and/or settings were either corrupted or incorrectly set. "

So, this is what I've been kind of thinking myself since I seem to be getting all sorts of funny errors the last few weeks. An error in vs came up previously even that suggested that there might be some corrupt memory on the computer. So, the computer is getting rebult tomorrow, hopefully that might help

Thanks Aiden

Accepted Solution

AidenA earned 0 total points
ID: 22939394
Yes, that has fixed the problem. Basically just got a new computer and reinstalled everything. Querybuilder comes up now. Think there might have been some faulty memory or somthing like that.

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question