Adding Columns to Jet/Access database

  • Thread starter Thread starter johnb41
  • Start date Start date
J

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
 
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
 
johnb41 said:
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
 
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
 
Cor Ligthert said:
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
 
Cor Ligthert said:
cmd.ExecuteNonQuery

(without a semicolumn otherwise it is C#)

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

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

John
 
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
 
¤ 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)
 
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
 
¤ 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)
 
Back
Top