Solved

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

Posted on 2014-12-29
2
84 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:ADITYA RAO
[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 Comments
 
LVL 34

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:ADITYA RAO
ID: 40534885
Yes this solution worked
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

739 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