Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make path in 'sConnString' dynamic ??? 1

Status
Not open for further replies.

rdjohnso

Programmer
Mar 30, 2001
67
US
I need to somehow be able to get path of Db file at current location and dynamically insert it into the path source....

How do I do this?

Orig:
sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\MyName\My Documents\Blue&White.mdb;"

New:
sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=#????#;
 
Something like:
sConnString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
CurrentProject.Path & ";
 
[tt]CurrentProject.Path & "\" CurrentProject.Name[/tt]

You could insert this into [tt]sConnString[/tt] a number of ways:[ol][li]Find/Replace.[/li][li][tt]Split()[/tt], change the [tt]Data Source[/tt], then glue back together.[/li][/ol]

Hope this helps,
CMP

Funny thing about being unemployed, weekends don't mean quite so much, just means you get to hang out with your working friends. Primus
 
And also

CurrentProject.Path & "\" & CurrentProject.Name = CurrentProject.FullName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top