CDaoTableDef - Changing database field properties (ie.text length)

I'm developing an application that uses the MicroSoft Access Jet DB engine.
This is being done using C++ in VS.net. 
I need to change the user's db when they use the new version of the program. 
In particular I need to change the length of a text field in a pre-existing 
db without loosing the user's data. When I wanted to add a new field I used 
CDaoTableDef and it worked fine, but I can't locate a method to just update  
an existing field's properties.

Any Ideas on how this can be done??

Thanks, Neil

0
NeilB (111)
4/26/2005 12:41:02 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
1215 Views

Similar Articles

[PageSpeed] 54

Neil

if you need to alter the attributes of a tabledef object, you create a new
one from the old one, modify the attributes, then append to the database to
add the new onw, then delte the old one.

however, you can do the column update through SQL - have a look at this
link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acintsql.asp

regards
roy fine

"Neil B" <NeilB@discussions.microsoft.com> wrote in message
news:F647FB86-7AA6-4A42-81A7-79139D6CAFA2@microsoft.com...
> I'm developing an application that uses the MicroSoft Access Jet DB
engine.
> This is being done using C++ in VS.net.
> I need to change the user's db when they use the new version of the
program.
> In particular I need to change the length of a text field in a
pre-existing
> db without loosing the user's data. When I wanted to add a new field I
used
> CDaoTableDef and it worked fine, but I can't locate a method to just
update
> an existing field's properties.
>
> Any Ideas on how this can be done??
>
> Thanks, Neil
>


0
rlfine8815 (162)
4/28/2005 1:00:57 AM
Reply:

Similar Artilces:

Extract emails from cells with text
I have a row in column A which includes an email address in the text that I'd like to extract to column B. Is there a formula I can use to accomplish extracting the email address only to column B? Here's an example of different cells in column A: Please email example@law.ufl.edu to contact us...... OR Schedule an appointment for assistance, or email example@uga.edu with your questions... Thank you Try this... All on one line: =TRIM(RIGHT(SUBSTITUTE(LEFT(A1,FIND (" ",A1&" ",FIND("@",A1))-1)," ", REPT(" ",...

Filter to select from various fields on opening a form
I have a form called TDC and want to filter data in the following fields on opening the form: DiaryAction (text field); DiaryCategory (text field); DiarySubCategory (text field); Company (text field); ContactType (text field); DiaryItemClosed (a Yes/No field). At the same time, I want the option not to select anything in each of these fields. Please could somebody give me the steps to do this. I am doing this in Access 2007, but am creating it as an Access 2003 database. Thank you for any help. I meant to say that I want this from dropdown boxes, but forgot to say becau...

Excel: extract and sum numerals from mixed text/numeral cell range
I have a large (30x20) grid of cells with data, and I want to extract and then sum up certain numerals from this entire range. The catch is that the data is mixed numerals and text, as you'll see below. Here's an abbreviated 3x3 example, with a value in each of the nine cells: V7.1 T H P1 A T B V3 P4.5 If I just wanted to sum up the instances of "T" appearing, I could use COUNTIF() for the entire range to come up with answer ("T" appears 2 times). Easy enough. But, what I'm trying to accomplish is to sum up the numerals associated w...

Database / Items
I open Store Operations Manager. I open Database / Items. How do I customise the columns in Items dialog box. I want to add "Cost" column next to "Price" column for quick review. I am using ver 1.3 Thanks Don You can't modify the built in forms. You could build a custom Add-in that displays what you want. Digital Retail Solutions has an existing Add-in that does allow you to modify the displayed columns - search the newsgroup, they post occasionally. As a work around, you use an item report (Item Quantity List maybe). Use Add/Remove columns to display the ...

Database diagram from reverse engineering
I have just installed Visio 2000 Enterprise for the purpose of creating an entity relationship diagram of an existing database I am administering. The database is complex, with over 100 tables, many of which contain more than 100 fields. It is the repository for OLTP data. I was able to "reverse engineer" up to the point of creating the list of tables, but when I place one of the tables on the "page, two problems are apparent: First, the tables are twice the size of the page, and second, there are no connections drawn to indicate the relations betweeen the tables. If I...

Recieved messages have "None" in the "From" Field
I've seen a number of people who couldn't send messages due to a similar problem. A whole string of my emails (recieved) no longer have anyone in the "From" Field, although they do have dates in the "Date" Field. When I double-click the message, it opens and shows me the "From" Field, but then the "Date" Field is blank. This just happened, spontaneously, I believe. Thanks in advance, Will Stewart ...

Adding database data to a combo box...
Hi guys, I have a working databse query thar returns a list of names. I want to put this into a combo box. Currently I am inserting the database data into a range on my spreadsheet (A1) and it uses as many rows as there are names. In my combo box properties I can specify the ListFillRange as A1:A5 or whatever and this works okay, but the thing is, as names are added to the database, I want the range A1:A5 to update dynamically. Q1. Can I send the QueryTable data directly to the combo box ListFillRange... With ActiveSheet.QueryTables.Add(Co=ADnnection:=3Dconnstring, Destination:=3DCo...

Export track lists to database
Is it possible to export track lists as text files to a database such as Excel? i-tunes has this facility I'm using Windows Media Player 11 with XP on a PC On Wed, 20 Jan 2010 04:48:01 -0800, Denis the Baron <Denis the Baron@discussions.microsoft.com> wrote: >Is it possible to export track lists as text files to a database such as Excel? > i-tunes has this facility >I'm using Windows Media Player 11 with XP on a PC Sure. Create a big stonking playlist with all your tracks on it. Then head over to grab the Power Toys for media player, which has an Expo...

In Excel how do I force text into next line before first is full?
,I am using Office XPPro (PC) but although I used Word a lot before I retired I am only now trying to do things in Excel (and incidentally Access). I want to put the membership records of a club into an Excel spreadsheet and to show each postal address divided (as it would be on an envelope) into several lines, some of them short. Since, when I am typing in data, pressing the Return key takes me to the next cell, not the next line, at present wherever I want a line break I am having to put in enough extra spaces to push the next word over the edge of the cell so that it wraps i...

need to get form property
hi, this is probably a very easy solution but I can't figure it out. I have Form A (frm_ARCall), subForm B (sfrm_ARCallInv) and Form C. From Form C, I want to change the Record Source property of subform B. I have tried many things but they have all failed. The latest is: Forms![frm_ARCall]![sfrm_ARCallInv]![Form].[RecordSource] = "fqry_ttARCallInv" NOTE: This line of code is on Form C which is a subform on another form (Form D). Please help -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201002/1 t...

IE 6.0 hanging when sutting down.
I am using windows XP with IE 6.0. When shutting down Iexplorer.exe is hanging up and not letting the computer shut down. The irony part of this is, I do shut everything down on my desktop. There are nothing on the taskbar to indicate anything is open. I even did a control, alt & delete to make sure everything is shut down and it still does the same thing. I have not added any new hardward, or software. I do have windows set for automatic updates. Could it be a bad update? Any help would be appreciated. Thanks. -- Wayne wayne937 wrote: > I am using windows XP with IE 6...

problem displaying UTF-8 in IE
Hi i've a UTF-8 file that holds some korean characters. A method of my com returns that string read from this file.since this dll is called from an asp page so the string has to be displayed in a browser. i dont know but i dont see the korean characters in IE rather some junk characters..this happens with UTF-8 Encoding selected for browser..Also with Korean Encoding i can see the korean char. but not what are in files..rather something else. To debug the application i wrote the characters read from the file to another file before returning from the com method..and they are exactly same a...

Setting Focus on the Body (Message) field
How do I set the focus on the Body(message) field in outlook 2k? I have tried Set myInspector = Item.GetInspector Set myPage = myInspector.ModifiedFormPages("Message") myPage.Message.SetFocus 'mypage.body.setfocus but this does not seem to be working. Thanks ...

Access 97
I converted an access 97 mdb to access 2003, and there were 2 conversion errors. The Table error here>> "-1017: Could not find field 'Description'." I figured this could be resolved by doing a compact and repair, before converting. The Module error here>> "There were compilation errors during the conversion or enabling of this database.@This might be due to old DAO syntax that is no longer supported. For an example on how to fixup the code, click Help. @@2@611705@1" doesn't tell me much of anything, these were copied from the error table. I ...

Visio
I have started to learn UML class diagram design and am using Visio 2003 (SP1) with Software > UML Model Diagram template as by base for design. My biggest frustration right now trying to model i cannot change the Type to anything expect for the items already in the list. Is there any way to add custom text to this? Help would be appreciated. ...

CDaoTableDef::OpenRecordset()
MSVC 6.0, MFC app fails to CDaoRecordset::OpenRecSet() on a linked table in an Access 2000 mdb file. DAO Call Failed. m_pTableDef->m_pDAOTableDef->OpenRecordset( COleVariant((long)m_nOpenType), COleVariant((long)m_nOptions), &m_pDAORecordset) In file daocore.cpp on line 3323 scode = 800A0C93 I suspect that this is because linking the table does not provide access to its tabledef. Is this so? Is there a way around it? Thanks, Geoff Don't you use the try/catch(CDaoException* e) blocks to get the extended error/problem information? Victor "Geoff Turnbull" <...

Formula to increment sequence only if text in a particular cell
Hi, I'm new to this, and not sure how to do this, I'd like to increment a field by one only if there's text in a particular cell. This is what I have, so I'm trying to write a formula that automatically populates column A...this is what I have tried =IF(C4<>"","Test_"&TEXT(ROW(A1),"000"), "") --- but this formula increments even when no text in B, so I end up with a value of Test_003 in A3, where I need to have Test_002 A B 1 Test_001 some text 2 ...

Offline Defrag of Exchange 2003 not representing database size cor
I have Exchange 2003 Sp2 installed. I need to do an offline defrag due to database size. My database should be 15Gb smaller than the actual database size. When I run eseutil the defrag completes successfully but doesnt change the file size. The online defrag run correctly but only free up 10-15Mb. Any suggestions? What makes you think it should be 15GB smaller than it is? Nue "Lynn" <Lynn@discussions.microsoft.com> wrote in message news:C8047F0C-D1DE-49B4-96AD-4F8B572CF381@microsoft.com... >I have Exchange 2003 Sp2 installed. I need to do an offline defrag due to >...

MS ACCESS REPORT EXPORT TO TEXT FILE
I have an Access Report which I am using to create a text file for upload into a 3rd party application. When Access exports the text file it is creating a carriage return (i.e., empty row) in the first row of the created text file thereby making the file incompatible for upload to the 3rd party. Is there a setting I need to select to prevent this from happening? Any suggestion you may have would be appreciated. Thanks in advance for your help! Regards Thanks Eric. "Eric Blitzer" wrote: > If you are creating a file for import you would be better of exporting the > que...

2008: importing 2004 rules + database daemon
I just read further troubling news on Macfixit. They report that Entourage 2008 does not import Entourage 2004 Rules. I have probably over 100 rules, that is a major problem. Can anyone confirm this? Also, it appears there is no way to disable the Office notifications in 2008. Is this true? I hope MS will address these problems. I'd like to upgrade for the speed on my intel laptop, but so far it seems there are just too many problems. -- --Loren On 3/14/08 5:11 PM, in article 140320082011095607%loren@nonono2spam.com, "Loren" <loren@nonono2spam.com> wrote: > I ...

Huge Office X Database, Small Office 2004 Database
I am running OS 10.3.9 on a newer PB. Prior to last week, I had been using Office X. Due to a problem with the max file size of Entourage, I switched to Office 2004. I've been using Office 2004 (heavily) for about a week. Today I looked in the MS User Data folder for Office 2004 and was shocked to see that the Database file was only 18MB in size and has a last modified date that corrisponds to the date I installed 2004. My Office X Database file is at 2.27GB and has a modification date of today. I'd like to uninstall Office X, but am afraid that I'll also loose all my data. Can ...

Importing text from an Explorer window
Howdy all. OS: XP, Excel 2002 SP3 I have my music stored in the My Music directory. I have Artist, Album Title, etc. attributes turned on. What I'd like to do is to take all of this information and input it into an Excel spreadsheet. When I "Select All" from the window, and "Copy", it wants to copy the actual songs, and not the text. Also, the "Paste" option in Excel is grayed out anyway. Is there a way that I can treat the info in a Browser window as just text, and then copy that info into a spreadsheet? TIA. -- Don Cox Here is one I have used...

Memo Fields
I'm trying to collect data for a multiple record update and place it into a memo field. The application steps through a record set compiling the data to a text box on a form while not eor Me![Text1] = Me![Text1] & ", " & Me![RecordData] Wend This works fine. When I look at Me![Text1] after the While loop all the data is correct. I then place this filed into a table using a simple append query, but when I look in the table the information is truncated with many non-alpha charaters at the end. Any thoughts? On Tue, 26 Feb 2008 08:54:01 -0800, Justin <Justin...

protecting a text box in spreadshhet
This is defeating me I have a text box in an excel sheet, I can protect the sheet ok but the text box always remains unprotected (ie the user could change the text) How do I protect it? thank you. Un-protect the sheet Right-click on edge of TextBox and Format TextBox>Protection Protect the sheet. Gord Dibben MS Excel MVP On Fri, 22 Oct 2010 16:42:21 +0100, "SS" <nonense50@blueyonder.co.uk> wrote: >This is defeating me I have a text box in an excel sheet, I can protect the >sheet ok but the text box always remains unprotected (ie the user could >ch...

IE 8 won't connect to the internet
I had a couple of trojan virus that I removed with my AV software yesterday and IE won't connect to the internet anymore. I've tried reinstalling the software but it didn't fix the error. I'm running IE 8 on XP SP2. The viruses were: trojan.win32.FraudPack.aunu Found in: c:\documents and settings\user\local settings\application data\gcglamgto\wtxaeustssd.exe c:\documents and settings\user\local settings\temp\xhctgo.exe c:\system volume information\_restore{1368902D-6A36-4B35-812D-DDC763090AC0rp16A0019233.exe IE8 with XP SP2? That combo sounds extremely...