Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

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
0
Navicerts
Asked:
Navicerts
  • 3
  • 2
1 Solution
 
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
 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now