Solved

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

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

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 34

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

617 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