Solved

Old database of access  needs to be altered  through VC++

Posted on 2014-12-29
2
72 Views
Last Modified: 2015-01-06
while handling old project it is required to update  database at  client side.Following code I  have  done.Instead of dynaset,I tried dynamic,snapshot,forwardonly  but nothing works for update script.for select string it works fine.
Please  help  me  as early as possible
       
       
 CString sDsn;
	 sDsn= _T("ODBC;DSN=Report;Pwd=tratra"); 
	 CDatabase objMerilDB;
	 objMerilDB.Open(NULL,false,false,sDsn);
	 CRecordset objRecordSet;
	 objRecordSet.m_pDatabase = &objMerilDB;
	 CString strQuery = "ALTER TABLE result ALTER COLUMN IdTest Text";
	 objRecordSet.Open(CRecordset::OpenType::dynaset, strQuery);

Open in new window

0
Comment
Question by:enthurao
2 Comments
 
LVL 33

Accepted Solution

by:
sarabande earned 500 total points
ID: 40523054
you may not use a CRecordset. instead, after objMerilDB.Open has returned without error, use

objMerilDB.SQLExecute(_T("ALTER TABLE result ALTER COLUMN IdTest Text"));

Open in new window


Sara
0
 

Author Closing Comment

by:enthurao
ID: 40534885
Yes this solution worked
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

20 Experts available now in Live!

Get 1:1 Help Now