Solved

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

Posted on 2014-12-29
2
70 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 32

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

22 Experts available now in Live!

Get 1:1 Help Now