Solved

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

Posted on 2011-03-18
4
294 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 33

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 33

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

776 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