Google Answers Logo
View Question
 
Q: c++ ado connection with connection string obtained at runtime ( No Answer,   0 Comments )
Question  
Subject: c++ ado connection with connection string obtained at runtime
Category: Computers > Programming
Asked by: yagiroy-ga
List Price: $20.00
Posted: 30 May 2004 00:07 PDT
Expires: 02 Jun 2004 19:57 PDT
Question ID: 353778
i can connect with a design time hard coded string but not with one i
get from console input at runtime.

	//works fine:
	bstr_t strCnn = "Provider='sqloledb';Data
Source='OKSANA\\OKSANA';Initial Catalog='pubs';Integrated
Security='SSPI';User ID=bla;Password=bla";

//works when myString was assigned hard coded connect string.
const _bstr_t strCnn(myString.c_str());	

the above line will not work if myString got it's value from console
input with or without the const at the beginning of the line. I've
tried char arrays and char *, nothing works if i don't hard code the
string.

Clarification of Question by yagiroy-ga on 02 Jun 2004 19:57 PDT
i found the problem, the double backslash needs to be replaced with a
single backslash when passing from the command line because in this
case the string doesn't need to be parsed and because of this escaping
the backslash is wrong.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy