Home All Groups Group Topic Archive Search About

Adding Columns to Jet/Access database

Author
29 Jun 2005 4:08 AM
johnb41
I need to Add, delete, rename, etc columns in my Jet/Access database in
my app.

I know I can add columns for a dataset, and work with it, but as far as
I know there is no way to push the added table to the original database
via .NET.

Is there something I'm missing from ADO.NET that allows this? Or do I
have to use the SQL syntax for adding and editing columns?

Thanks for your help!

John

Author
29 Jun 2005 5:42 AM
Cor Ligthert
John,

To do what you ask, you n can do using SQL statements (strings) those are
executed with

OleDbcommand.executenonquery

On this page are the SQL commands from access very complete described.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acfundsql.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acintsql.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acadvsql.asp

I hope this helps a little bit?

Cor
Author
29 Jun 2005 1:13 PM
johnb41
Cor,

Oh my god!  Those articles go in depth.  Who would have known SQL is so
deep?!  Those links are keepers, thanks!

John
Author
29 Jun 2005 3:10 PM
johnb41
I searched all 3 links, and there is no command for "Renaming" a table.
I searched the web, and SQL does have a Rename command.  Is it not
available for Jet/Access?

Does anyone know how to rename a table in SQL for Jet/Access?

Thanks,
John
Author
29 Jun 2005 3:34 PM
Paul Clement
On 29 Jun 2005 08:10:55 -0700, "johnb41" <ord***@informatik.com> wrote:

¤ I searched all 3 links, and there is no command for "Renaming" a table.
¤  I searched the web, and SQL does have a Rename command.  Is it not
¤ available for Jet/Access?
¤
¤ Does anyone know how to rename a table in SQL for Jet/Access?

I believe that only DAO can do this using the TableDefs collection.


Paul
~~~~
Microsoft MVP (Visual Basic)
Author
2 Jul 2005 8:24 AM
m.posseth
Nope ,,, ADOX can do this to

and is not declared Obsolete by MS   :-)   as DAO is




Show quoteHide quote
"Paul Clement" <UseAdddressAtEndofMess***@swspectrum.com> schreef in bericht
news:1ff5c1lapbo3f324jteto9t4mhes5atvgs@4ax.com...
> On 29 Jun 2005 08:10:55 -0700, "johnb41" <ord***@informatik.com> wrote:
>
> ¤ I searched all 3 links, and there is no command for "Renaming" a table.
> ¤  I searched the web, and SQL does have a Rename command.  Is it not
> ¤ available for Jet/Access?
> ¤
> ¤ Does anyone know how to rename a table in SQL for Jet/Access?
>
> I believe that only DAO can do this using the TableDefs collection.
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
Author
5 Jul 2005 7:40 PM
Paul Clement
On Sat, 2 Jul 2005 10:24:52 +0200, "m.posseth" <poss***@planet.nl> wrote:

¤ Nope ,,, ADOX can do this to
¤

Yeah it looks like you're correct. You can change it through the Name property:

Dim cat As New ADOX.Catalog

cat.ActiveConnection = _
   "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=e:\My Documents\db1.mdb;" & _
   "Jet OLEDB:Engine Type=4"

cat.Tables("TableName").NAME = "NewTableName"

¤ and is not declared Obsolete by MS   :-)   as DAO is

Actually they still support DAO. I've queried them on this recently. However, ADO/ADOX is
recommended under .NET if you need features not supported in ADO.NET.

AFAIK, there is no new development for either.


Paul
~~~~
Microsoft MVP (Visual Basic)
Author
29 Jun 2005 5:03 PM
Cor Ligthert
John,

I hate SQL. For renaming or whatever is AFAIK used in that slang the word
"modify".

However the best change you have is to follow Armins advice and ask this
question in the newsgroep and otherwise follow Pauls advice.

Adonet
news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet

In that newsgroup are people when you awake them with a question about SQL
they have direct the answer.

I hope this helps,

Cor
Author
29 Jun 2005 6:07 AM
Armin Zingler
"johnb41" <ord***@informatik.com> schrieb
> I need to Add, delete, rename, etc columns in my Jet/Access database
> in my app.
>
> I know I can add columns for a dataset, and work with it, but as far
> as I know there is no way to push the added table to the original
> database via .NET.
>
> Is there something I'm missing from ADO.NET that allows this? Or do
> I have to use the SQL syntax for adding and editing columns?
>
> Thanks for your help!
>

There is no VB language keyword for this. Please note that there is an
ADO.Net newsgroup for language unrelated questions: m.p.d.framework.adonet


Armin
Author
29 Jun 2005 6:18 AM
Cor Ligthert
> There is no VB language keyword for this. Please note that there is an
> ADO.Net newsgroup for language unrelated questions: m.p.d.framework.adonet
>
cmd.ExecuteNonQuery

(without a semicolumn otherwise it is C#)

:-)

The rest is Adonet.

:-)

Cor
Author
29 Jun 2005 6:33 AM
Armin Zingler
Show quote Hide quote
"Cor Ligthert" <notmyfirstn***@planet.nl> schrieb
> > There is no VB language keyword for this. Please note that there
> > is an ADO.Net newsgroup for language unrelated questions:
> > m.p.d.framework.adonet
> >
> cmd.ExecuteNonQuery
>
> (without a semicolumn otherwise it is C#)
>
> :-)
>
> The rest is Adonet.
>
> :-)

I'm sure he knows how to call a procedure in VB.

:)

Armin
Author
29 Jun 2005 12:33 PM
Herfried K. Wagner [MVP]
"Cor Ligthert" <notmyfirstn***@planet.nl> schrieb:
>> There is no VB language keyword for this. Please note that there is an
>> ADO.Net newsgroup for language unrelated questions:
>> m.p.d.framework.adonet
>>
> cmd.ExecuteNonQuery
>
> (without a semicolumn otherwise it is C#)

Yeah, but hopefully with '()' on the end (although this is not mandatory).

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>