tinker
04-15-2009, 08:12 AM
I need to read (read-only) an Access database where the name of database will change depending on the current date. On my workstation, I set the connection string in the code file like:
string strFilePath = "E:\\databases\\" + DateTime.Now.ToString("MMyy") + ".mdb";
And use it first as:
FileInfo objTestFile = new FileInfo(strFilePath);
litUpdated.Text = string.Format("{0:h:mm tt on MMMM d, yyyy}", objTestFile.LastWriteTime);
I've been playing with this all day to use the "_database" folder, and cannot seem to get it right.
Help, please?
(I'm not locked in to doing this is the code file, but if there's a way to combine a <connenctionString> with a variable file name, I haven't found it..)
- Tinker
string strFilePath = "E:\\databases\\" + DateTime.Now.ToString("MMyy") + ".mdb";
And use it first as:
FileInfo objTestFile = new FileInfo(strFilePath);
litUpdated.Text = string.Format("{0:h:mm tt on MMMM d, yyyy}", objTestFile.LastWriteTime);
I've been playing with this all day to use the "_database" folder, and cannot seem to get it right.
Help, please?
(I'm not locked in to doing this is the code file, but if there's a way to combine a <connenctionString> with a variable file name, I haven't found it..)
- Tinker