RE: database access from VC++
- From: Manjree Garg <garg@xxxxxxxxxxxxxxxx>
- Date: Fri, 8 Jun 2007 01:59:01 -0700
Hi Charles
Thank you so much for your suggestions. It did help. Well, I've already
installed .NET framework on my computer and using SQL server 2005 database.
It seems that ADO.net would be the best option. I checked the site
Data Access Using ADO.NET in C++
http://msdn2.microsoft.com/en-us/library/9ctka9db(VS.80).aspx
It shows how to access data (creating/modifying tables) using ADO.net
DataTable object. But my database already exist in SQL server 2005. I need to
access SQL server 2005 database from VC++ interface.
Is there any difference in native and unmanaged code?
Manjree
"Charles Wang[MSFT]" wrote:
Hi Manjree,.
I think that anyone of the three ways is OK. This depends on your
requiremnets. If you do not want to install .NET framework, you can use MFC
classes like CDatabase, CRecordset, OLE DB templates like CCommand and ADO.
For ADO.NET, you can interact with your ADO.NET database from native code,
however that requires your compiling your application with /clr switch.
For more information, you may refer to:
Data Access Using ADO.NET in C++
http://msdn2.microsoft.com/en-us/library/9ctka9db(VS.80).aspx
Using the CDatabase class to read an Access databases
http://www.codeproject.com/database/readdb.asp
How to avoid the ODBC login dialog box when using MFC in Visual C++
http://support.microsoft.com/kb/q150552/
Visual C++ ADO Programming
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/
mdhowhowvcusersshouldreadadodocumentation.asp
CCommand Class
http://msdn2.microsoft.com/en-us/library/yfte190h(VS.80).aspx
How to use the Visual C++ ATL Consumer templates to perform a distributed
query
http://support.microsoft.com/kb/198485
If your SQL Server is 2005, I recommend that you use ADO.NET or OLE DB
templates. ADO programming seems a bit more complex than other methods.
Hope this helps. If you have any other questions or concerns, please feel
free to let me know. It is my pleasure to be of assistance.
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
- Follow-Ups:
- RE: database access from VC++
- From: Charles Wang[MSFT]
- RE: database access from VC++
- From: Charles Wang[MSFT]
- RE: database access from VC++
- References:
- RE: database access from VC++
- From: Charles Wang[MSFT]
- RE: database access from VC++
- Prev by Date: RE: database access from VC++
- Next by Date: RE: database access from VC++
- Previous by thread: RE: database access from VC++
- Next by thread: RE: database access from VC++
- Index(es):
Relevant Pages
|