Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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.

  • Leaders
Posted
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)?
--tim
  • *Experts*
Posted

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

"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
Posted

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

Posted

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

Posted

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

  • *Experts*
Posted

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

"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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...