|
|
Subject:
dynamic connect string in c++ ado against sql server string conversion problem
Category: Computers > Programming Asked by: yagiroy-ga List Price: $20.00 |
Posted:
29 May 2004 20:41 PDT
Expires: 29 May 2004 22:15 PDT Question ID: 353730 |
I'm writing an unmanaged c++ console app. I'm using ado to connect to a sql server 2000 database and query it. When I hard code the db connection string connecting to the db works fine. The problem is that when I read the string in from the console into a variable and try to use the variable -- I can't get that to work. this works: _bstr_t strCnn("my database connection string"); none of this works: string targetConnectString; cout << "enter target connection string: "; getline(cin, targetConnectString); const char * t = targetConnectString.c_str(); const _bstr_t bstr = targetConnectString.c_str(); it will compile but it won't connect succesfuly. so the question is how do i connect with a dynamic string? i think it's a conversion problem i'm failing to solve. |
|
There is no answer at this time. |
|
There are no comments at this time. |
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 Home - Answers FAQ - Terms of Service - Privacy Policy |