Re: How to create a checkbox datatype column in a table in VB .net code



evan1979.2@xxxxxxxxx wrote:
I am creating a new boolean column in a MSAccess .mdb database like
this:

Dim Cmd As New OleDb.OleDbCommand("ALTER TABLE m_table ADD boolColumn
YesNo", objConn)
Cmd.ExecuteNonQuery()

, which works fine. But... when the .mdb file is opened in Access the
values for the new column are shown as "-1" and "0"...

Is there a way to make the column display in Access as checkboxes? I
want to be able to do this at runtime in my .net program.

Definitely not with ADO, and probably not with ADO.Net. You will probably
need to automate Access to do this, but i could be wrong.

There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic (COM-based) ADO newsgroup.
ADO.Net bears very little resemblance to classic ADO so, while you may be
lucky enough to
find a dotnet-knowledgeable person here who can answer your question, you
can eliminate the luck factor by posting your question to a group where
those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.adonet.


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages