Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-03-18
4
Medium Priority
?
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 35

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 35

Accepted Solution

by:
ste5an earned 1000 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

715 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