Link to home
Start Free TrialLog in
Avatar of Navicerts
NavicertsFlag for United States of America

asked on

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
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

try inserting the complete path

DBLocation = "C:\Documents and Settings\{username}\My Docuemnts\HandheldDBWeight.sdf"
Avatar of Navicerts

ASKER

It is on a handheld device, "\My Documents\HandheldDBWeight.sdf" is the complete path in this case.
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="
ASKER CERTIFIED SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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