473,395 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

MC++ && MS SQL

I have read some codes like following:
///////////////////////////////////////////
SqlConnection* conn =
new SqlConnection(S"Server=localhost;"
S"Database=Northwind;"
S"Integrated Security=true;");

adapter = new SqlDataAdapter(S"SELECT * FROM Employees", conn);

eventHandler = new SqlEventHandler(adapter, this);

commandBuilder = new SqlCommandBuilder(adapter);

conn->Open();
///////////////////////////////////////////

I wondered can we link to the database without username and password?
Nov 17 '05 #1
1 1306
Tim
In your example, you are doing exactly that - you are using a Trusted
Connection aka Integrated Security aka SSPI context. The Trusted connection
is the logged on connection you already have. This needs to be setup in SQL
Server.

The alternative is to specify a UserName and Password in the SqlConnection -
this username and password has to be registered in SQL Server with
permissions to the database(s) and objects you require.

- Tim

"hangaround" <ha********@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com...
I have read some codes like following:
///////////////////////////////////////////
SqlConnection* conn =
new SqlConnection(S"Server=localhost;"
S"Database=Northwind;"
S"Integrated Security=true;");

adapter = new SqlDataAdapter(S"SELECT * FROM Employees", conn);

eventHandler = new SqlEventHandler(adapter, this);

commandBuilder = new SqlCommandBuilder(adapter);

conn->Open();
///////////////////////////////////////////

I wondered can we link to the database without username and password?

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jonathan Snook | last post by:
Witty subject aside, I have an issue... shouldn't &trade; or it's numerical equivilent ™ be language independent? Such that if the language of the document is set to "fr" it would be the MC instead...
0
by: Daniel Lidström | last post by:
Hi, I've been trying a long time now to generate some XML using MC++ and XmlSerializer. I have a piece of C# code that produces exactly what I want, but I simply can't get the MC++ code to write...
1
by: GERALD SHAW | last post by:
Acc 97 Hi, I have the following in my query which works well if it is all set to numbers on table design. But what I want to do is where it states MC (short for machine name) use the actual...
5
by: Scott Chang | last post by:
Hi all, I copied a set of VC++ version 6 source code of the 'cppdll'(2 projects) from a website and put the cppdll.cpp, cppdll.def, cpp.h, (as the 1st project) and test.cpp (as the 2nd project)...
7
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
3
by: | last post by:
is there any performance diffrence between MC++ 2003 ,other .NET languages and MC++ 2005 (cause of an optimization) ???
7
by: Dmitry Shuklin | last post by:
I am compiled my C file into IL source, How i can compile this file back to OBJ file, not to EXE or DLL? or, can i compile to OBJ file VB or C# code and link them with C++ managed OBJ files? ...
7
by: key9 | last post by:
Hi ALL. Basic Question. sample: class MyClass { ....
12
by: MC | last post by:
Hi all, I have write a simple program in c# that change proxy setting for IE7 by edit these registry keys: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.