Solved

How to change DB constraint using OLE DB in Visual C++

Posted on 2011-03-18
4
289 Views
Last Modified: 2012-05-11
Hi

I am forced to do some work in a old program written in Visual C++ using OLE DB for database access. And I doesn't understand how to change a constraint for a column using OLE DB.

The actual databse i s MS Access, compiler Visual Studio 2010

Thanks
0
Comment
Question by:JasonMewes
  • 2
  • 2
4 Comments
 
LVL 32

Expert Comment

by:ste5an
ID: 35171276
hi,

use Jet SQL DDL to do this:

http://msdn.microsoft.com/en-us/library/aa140011%28v=office.10%29.aspx
http://msdn.microsoft.com/en-us/library/aa140015%28v=office.10%29.aspx
http://msdn.microsoft.com/en-us/library/aa139977%28v=office.10%29.aspx

Caveat: you cannot change everything which you can do in the Table Designer. For these things you need to use DAO.

mfG
--> stefan <--
0
 

Author Comment

by:JasonMewes
ID: 35179003
So it's not possible using OLE DB?
0
 
LVL 32

Accepted Solution

by:
ste5an earned 500 total points
ID: 35179229
Sure, it's possible. OLE DB has no object model to do that like DAO has, so you need to issue DDL SQL against your database as described in the links how to use Jet SQL DDL.

The caveat refers especially to the features involving the Access GUI, e.g. look-up definitions for columns in the table design.

mfG
--> stefan <--
0
 

Author Closing Comment

by:JasonMewes
ID: 35231602
The solution was so hard to follow so that I hade to use a different approach
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now