470,620 Members | 1,728 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,620 developers. It's quick & easy.

Error creating database connection with field name "Section"

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
3 1832
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
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
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.

Similar topics

2 posts views Thread by Hartmut Sbosny | last post: by
4 posts views Thread by Jason Kendall | last post: by
2 posts views Thread by pedestrian via SQLMonster.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.