By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,344 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,344 IT Pros & Developers. It's quick & easy.

Error creating database connection with field name "Section"

P: n/a
I've run across a strange error when creating a simple ADO.Net
connection in VB.Net 2003

To replicate an error:
Create an Access database (2002) with table named "Student" and fields
SID (Autofill), FirstName and LastName.

Put some dummy data in table.

Start a new VB.Net application, create a new connection to your
database, drag fields on to form, complete wizard steps...no problem!

Close VB.Net, go back to Access, add field called "Section" (text
field), add some dummy data (i.e., A, B, C, etc)

Create a new VB.Net project, follow steps above, come up with the
following error:

The wizard detected the following problems when configuring the data
adapter
"OleDbDataAdapter1".

Details:
Generated SELECT statement.

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

For some reason, it seems that ADO.Net (or at least the wizard)
doesn't like a field named Section.

Any ideas on this?

Thanks,
Dave

Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Sounds like section is a reserved word in access, and the .net wizard can't
deal with it properly.

Yet another reason to avoid using the wizard and code by hand.

"Dave" <nl**@nospam.home.com> wrote in message
news:40**************@news.east.cox.net...
I've run across a strange error when creating a simple ADO.Net
connection in VB.Net 2003

To replicate an error:
Create an Access database (2002) with table named "Student" and fields
SID (Autofill), FirstName and LastName.

Put some dummy data in table.

Start a new VB.Net application, create a new connection to your
database, drag fields on to form, complete wizard steps...no problem!

Close VB.Net, go back to Access, add field called "Section" (text
field), add some dummy data (i.e., A, B, C, etc)

Create a new VB.Net project, follow steps above, come up with the
following error:

The wizard detected the following problems when configuring the data
adapter
"OleDbDataAdapter1".

Details:
Generated SELECT statement.

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

For some reason, it seems that ADO.Net (or at least the wizard)
doesn't like a field named Section.

Any ideas on this?

Thanks,
Dave

Nov 20 '05 #2

P: n/a
On Thu, 15 Jan 2004 16:24:40 GMT, nl**@nospam.home.com (Dave) wrote:

I've run across a strange error when creating a simple ADO.Net
connection in VB.Net 2003

To replicate an error:
Create an Access database (2002) with table named "Student" and fields
SID (Autofill), FirstName and LastName.

Put some dummy data in table.

Start a new VB.Net application, create a new connection to your
database, drag fields on to form, complete wizard steps...no problem!

Close VB.Net, go back to Access, add field called "Section" (text
field), add some dummy data (i.e., A, B, C, etc)

Create a new VB.Net project, follow steps above, come up with the
following error:

The wizard detected the following problems when configuring the data
adapter
"OleDbDataAdapter1".

Details:
Generated SELECT statement.

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

For some reason, it seems that ADO.Net (or at least the wizard)
doesn't like a field named Section.

Any ideas on this?

Yes, either enclose within brackets e.g. [Section] or don't use Access or ODBC reserved words:

ACC2002: Reserved Words in Microsoft Access
http://support.microsoft.com/default...b;en-us;286335

ACC2002: Microsoft Jet 4.0 Reserved Words
http://support.microsoft.com/default...b;en-us;321266

http://msdn.microsoft.com/library/de...dappcpr_17.asp
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #3

P: n/a
Thanks Paul!

So simple a problem...so hard to find...aren't they all that way!

Dave

On Thu, 15 Jan 2004 12:31:09 -0600, Paul Clement
<Us***********************@swspectrum.com> wrote:
On Thu, 15 Jan 2004 16:24:40 GMT, nl**@nospam.home.com (Dave) wrote:

I've run across a strange error when creating a simple ADO.Net
connection in VB.Net 2003

To replicate an error:
Create an Access database (2002) with table named "Student" and fields
SID (Autofill), FirstName and LastName.

Put some dummy data in table.

Start a new VB.Net application, create a new connection to your
database, drag fields on to form, complete wizard steps...no problem!

Close VB.Net, go back to Access, add field called "Section" (text
field), add some dummy data (i.e., A, B, C, etc)

Create a new VB.Net project, follow steps above, come up with the
following error:

The wizard detected the following problems when configuring the data
adapter
"OleDbDataAdapter1".

Details:
Generated SELECT statement.

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

For some reason, it seems that ADO.Net (or at least the wizard)
doesn't like a field named Section.

Any ideas on this?

Yes, either enclose within brackets e.g. [Section] or don't use Access or ODBC reserved words:

ACC2002: Reserved Words in Microsoft Access
http://support.microsoft.com/default...b;en-us;286335

ACC2002: Microsoft Jet 4.0 Reserved Words
http://support.microsoft.com/default...b;en-us;321266

http://msdn.microsoft.com/library/de...dappcpr_17.asp
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)


Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.