Solved

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

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

765 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