Variable in Connection String

Anyone know what im doing wrong here?  I have tried...
DBLocation = "\My Documents\HandheldDBWeight.sdf"
rda.LocalConnectionString = "Data Source=DBLocation;SSCE:Database Password="


And this....
DBLocation = "\My Documents\HandheldDBWeight.sdf"
rda.LocalConnectionString = "Data Source=" & DBLocation & ";SSCE:Database Password="

I think the question is self explainitory, let me know if not.

-Navicerts
LVL 7
NavicertsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brian CroweDatabase AdministratorCommented:
try inserting the complete path

DBLocation = "C:\Documents and Settings\{username}\My Docuemnts\HandheldDBWeight.sdf"
0
NavicertsAuthor Commented:
It is on a handheld device, "\My Documents\HandheldDBWeight.sdf" is the complete path in this case.
0
NavicertsAuthor Commented:
This is my original connection string that worked.  I didn't have any problems until i wanted to change it and replace the location with a variable.

rda.LocalConnectionString = "Data Source="\My Documents\HandheldDBWeight.sdf";SSCE:Database Password="
0
Brian CroweDatabase AdministratorCommented:
try this...

DBLocation = "\My Documents\HandheldDBWeight.sdf"
rda.LocalConnectionString = "Data Source=""" & DBLocation & """;SSCE:Database Password="
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NavicertsAuthor Commented:
When i read the last post you made i thought "oh, of course, that HAS to be it".  When i tried it im still crashing :(  I think that has to be correct though, i have another problem i need to fix before i can move on.  When i try to run the program in debug mode from my PC to my handheld in it's docking station im getting an error saying that it can't load the required files to run it in debug.  So now im not sure where the problem is anymore.

That has to be correct though, I just forgot it needs it's own quotes as well, so i will award the points and work on my de-bugging problem.

Thank you sir

-Navicerts
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.