Solved

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

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create a progress bar for timer 4 292
help with SQL 15 125
C++ - Loading Managed Assembly From Memory in Unmanaged Process 25 482
Parsing HTML in C# 10 138
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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