|
Posted by Erland Sommarskog on 04/01/07 18:45
raylopez99 (raylopez99@yahoo.com) writes:
> Thanks Erland--right now another problem that's sprung up is
> connecting to a simple database (the same one, this time the database
> 'works' fine, but accessing it from outside the SQL language via a
> console C++ program is the problem). See thread here:
> http://tinyurl.com/3e2nz8
You have a connection string that goes:
connection->ConnectionString = "User ID=sa; Password=;"
"Data Source=(local); Initial Catalog=DCV_DB;";
But didn't you say you were using SQL Express? By default, SQL Express is
installed as a named instance with the name SQLEXPRESS, in which case the
Data Source should be: (local)\SQLEXPRESS.
Did the User ID and Password come from that book? If you want your app
to run with Integrated Security, you should use
Integrated Security=SSPI;
instead. Having sa with a blank password is extremely bad practice, and
outright dangerous if the server is exposed on the Internet.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|