how can I reference the My Documents folder in a database connection string in VB 2008?

I am building a VB 2008 application that interfaces with a MS Access
database. I wish to change the connection string so It looks in the user’s My Documents folder rather than the current directory.

The problem is that the My Documents directory will be in a different place depending on the user’s OS and setup. Is there a way to code the connection string so that it goes to the my documents directory wherever it may be?

connectionString=”Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=|DataDirectory|\studentSurvey.accdb”

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Tags:

This entry was posted on Tuesday, March 30th, 2010 at 3:35 pm and is filed under Connection string. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

One Response to “how can I reference the My Documents folder in a database connection string in VB 2008?”

  1. Kevin Says:

Leave a Reply

 

About - Contact - Privacy Policy - Terms of Service