How to rename an Access database???

  • Thread starter Jon S via DotNetMonster.com
  • Start date
J

Jon S via DotNetMonster.com

Hi all,

I dont know if this can be done but I would like to programmatically change
an Access database name.

Say my database path and name was :

C:/myFolder/Test.mdb

What code would I use, in either C# or using ADO.NET, to change the above .
mdb name to Test2.mdb?

Thanks in advance.
 
F

Flip

I dont know if this can be done but I would like to programmatically
change
an Access database name.
Assuming the mdb is not currently open, you would just use the standard File
object to rename (I'm going from memory here, sorry). But if you're looking
for an ADO solution, you're in the wrong domain of solutions IMHO. The db
is just a file, therefore the file operations are what's in order.

HTH.
 
S

Sharon

Hi Jon.
Are you asking how to rename a file?
If so, check out System.IO.File.Move.
Sharon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top