Big Boabby Posted February 4, 2003 Posted February 4, 2003 Hi guys, I am just looking into .net (i usually use VB6). I understand that I need to use a data adapter to link to the database so that I can fill the dataset and bind the controls. I am trying to connect to an Access XP database. This is a simple test.mdb with a single table(Names) with Key, NameIn and Message as the fields. I place the adapter on the form, and the data adapter configuration wizard starts. I select Jet 4.0 oledb provider and enter the path, click test connection and it succeeds. Next, I am asked what I want to use to fill the data set, I only have the option of SQL so I click next and, using the query builder, I try a simple SELECT Names.* FROM Names but when I run the query I get an unspecified error. When I click next I get: The wizard detected the following problems when configuring the data adapter "OleDbDataAdapter1" Details: General SELECT statement Unspecified Error : E_Fail(0x80004005) I have tried to look for this in MSDN but so far have not found any helpful tips - can anyone help? Quote
Leaders quwiltw Posted February 4, 2003 Leaders Posted February 4, 2003 Strange. Do you have any problems with any other databases? Maybe try connecting to Northwind or something and see if it works? Quote --tim
Big Boabby Posted February 4, 2003 Author Posted February 4, 2003 Hi, Thank you for your response. It seems that the error is specific to my database then. The Northwind query ran successfully. Now then, is this an Access XP problem or is there a setting that I missed during set up, or an additional component I need to install? I am now completely baffled as to why my first attempt did not work. Thank you again. Quote
Leaders quwiltw Posted February 4, 2003 Leaders Posted February 4, 2003 I tried your column names on my box and it worked fine with Access XP, but perhaps if you either created a new test table or renamed Key to something else temporarily, maybe it isn't properly bracketing the Key column name (though it did on my box)? Quote --tim
*Experts* Nerseus Posted February 4, 2003 *Experts* Posted February 4, 2003 I wouldn't name your column "Key". The default SELECT statement is likely the problem, as "SELECT Key, ..." isn't allowed. You can code the SQL manually to use "SELECT [Key], ..." or just rename your column to a non-reserved word. -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Leaders quwiltw Posted February 4, 2003 Leaders Posted February 4, 2003 That's what I suspect his problem is but it's strange because the DataAdapter wizard on my box properly brackets the reserved word. Quote --tim
Big Boabby Posted February 4, 2003 Author Posted February 4, 2003 Hi guys and thanks again, I can confirm that my data adapter brackets the key field properly and even if I chnage the column names, I cannot get the connection. I can, however connect to Northwind and run the query successfully in the query builder. As for the Access XP problem - i'm still working on it! Cheers guys Quote
Big Boabby Posted February 4, 2003 Author Posted February 4, 2003 Ok folks, I have now established a connection by changing the whole database: Original Config: DATABASE: Test DB TABLE: Names FIELD1: Key FIELD2: Name FIELD3: Message New Config: DATABASE: Test TABLE: Testing FIELD1: KeyIn FIELD2: NameIn FIELS3: Message So whatever the specific problem, it must have been in one(or all!!) of the diferences in the two. Thanks for your support Quote
Leaders quwiltw Posted February 4, 2003 Leaders Posted February 4, 2003 strange. no chance you can isolate it further? were column names the only differences? Quote --tim
Big Boabby Posted February 4, 2003 Author Posted February 4, 2003 The changes were: Database filename from "Test DB" to "Test" Table name from "Names" to "Testing" Field1 from "Key" to "KeyIn" Field2 from "Name" to "NameIn" Field3 no changes Hope this helps Quote
*Experts* Nerseus Posted February 4, 2003 *Experts* Posted February 4, 2003 I think Names might be a reserved word. When I create an access table with the name "Names" and create a query, the default select shows "SELECT * FROM [Names]". It doesn't put brackets on other table names, such as tblNames, when I create queries for them. Note this is all from within Access itself. Oddly enough, I don't think "Name" is a reserved word. I'd double check against the Access documentation - things like this are best solved early so that you don't have to worry about a similar problem later. -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Leaders quwiltw Posted February 4, 2003 Leaders Posted February 4, 2003 Names is reserved. Learn something new everyday. Now I wonder if the dataadapter wizard just isn't smart enough to bracket it? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wp/htm/wpmigratingappendixd.asp Quote --tim
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.