[MFC + DAO] Data selection

Hi,

I've connection to database ( .mdb file) In one of tabels i've some fields: 
e.g like those:
idTab - Autonumering
idWho - Number
idOK - Number
idBad - Number

And what i want to do is:
const char pszIDTabFind[] = "idTab = %s ";

CString strId - ID taken from another table
CString str;

str.Format( pszIDTabFind, strID );

RS.FindFirst ( str );

And what i get? An exception:/ !! Sth like : "Operation for this object is 
not supported"  Why i can't find any data? What's more if i search for 
strings everything goes ok. Could You please tell me how should iI do that?

THX

GIGI 


0
5/4/2005 3:54:54 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
840 Views

Similar Articles

[PageSpeed] 10

GiGi la trotola wrote:
> Hi,
>
> I've connection to database ( .mdb file) In one of tabels i've some
fields:
> e.g like those:
> idTab - Autonumering
> idWho - Number
> idOK - Number
> idBad - Number
>
> And what i want to do is:
> const char pszIDTabFind[] = "idTab = %s ";
>
> CString strId - ID taken from another table
> CString str;
>
> str.Format( pszIDTabFind, strID );
>
> RS.FindFirst ( str );
>
> And what i get? An exception:/ !! Sth like : "Operation for this
object is
> not supported"  Why i can't find any data? What's more if i search
for
> strings everything goes ok. Could You please tell me how should iI do
that?
>
> THX
>
> GIGI

idTab is a field in your table BUT (more importantly) is it a field in
your recordset?

0
rquirk1 (133)
5/5/2005 7:38:21 AM
> idTab is a field in your table
Yes.
>BUT (more importantly) is it a field in
> your recordset?
I don't know. Do I have to declare it in some way?

GIGI 


0
5/5/2005 9:15:10 AM
Reply:

Similar Artilces:

Macro to Shade the selected cell
Hello, I am looking for a Excel 2007 macro that when run will shade the selected cell. Say I am in cell B9 and I run the macro, the cell will be shaded Yellow Thank you EggHeadCafe - Software Developer Portal of Choice XML Serializer Generator and Application Perfomance http://www.eggheadcafe.com/tutorials/aspnet/8eb0e68f-5496-4363-9cb9-dd68447ba187/xml-serializer-generator.aspx Turn on macro recorder and record the actions you do interactively. Press ALT+F11 and open the Module code to see what it has written. On Mon, 12 Oct 2009 16:25:42 -0700, Sukie Uppal wrote: >Hello, >I am lo...

A strange problem with MFC
Hi, Rencently I met a strange problem. The code like below: CWinThread* pThread = AfxBeginThread(ThreadFunc, (LPVOID)this, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED); if(pThread->m_hThread != NULL){ pThread->m_bAutodelete = FALSE; pThread->ResumeThread(); } After the statement "pThread->m_bAutodelete = FALSE" executed, I found the value of pThread->m_hThread is 0. While pThread->m_bAutodelete is still 1! The code section located in a win32 static library, with /Md option.The host application(exe) is a win32 console application, with /Md option. There...

Get external data-formats too
I have a file that gets data from another Excel spreadsheet. I want to have it retain the formatting (ie. indents) that were made on the imported file. Each time I refresh now, it left justifies everything...any ideas Thanks Hi, If your sheet just gets its data with '=Sheet1!A12'-style formulas, I don't think there's any way short of a macro reformatting the data like the old. Obviously, you can manually copy and paste special to get most of what you want, but it didn't sound like that's your situation... jeff >-----Original Message----- >I have a file that ...

Selecting data in Excel or word pad, shortcuts
Curious if there are any shortcut keys to select a group of data. For example, I'd like to put the cursor in a spot, hold the shift key and search for a word and have everything selected between the original cursor position and the word I search for. This seems pretty basic but I can't figure it out. I know of the standard shortcuts (control *, Shift and arrows, shift and page.....) but what about shift and find? Thanks very much for any help! P.S. Maybe somebody has a different way to handle this. I'm downloading data that is bigger than standard excel (maybe 150,000 lines...

Manually Data Collection
In Manufacturing we are doing Manually DC to get information about Ok an Rejection work on each and every opertation with in a Routing. During this process i found that DC Activity not attached with my MO, for exemple 1. I can enter any qty in Piece Ok or Rejected fields even if the Mo Qty 100 but for the same MO Data Collection can be done for 1000pcs. 2. In data collection form no information about MO Quantities. 3. As my operations are based on piece work bases and each operation in routing have diffrent rates as well labor, so when I am entring the MO receipt entry again there is no ...

Excel data merging into Word
I've created a directory and set up the mail merge. Chose "merge all records" and when I preview the directory per recipient, they are all there but when I do a final merge into new document, every other recipient appears; i.e., #1, 3, 5, 7 etc. Help!!! Hi Blondiegee, If your mailmerge main document has a «Next Record» field, delete it - they're not relevant to Directory merges. -- Cheers macropod [Microsoft MVP - Word] "Blondiegee" <Blondiegee@discussions.microsoft.com> wrote in message news:4B4ED484-FDC8-45EC-BCE3-0E19B03DA5...

Unicode in MFC
Hi, I am new to MFC programming and I have a problem: when I try to write the caption of a button or something else in my own language(Farsi), in the design mode it shows the correct string but when I compile it it shows a '?' instead of every character. Can anyone please help me with that. > I am new to MFC programming and I have a problem: > when I try to write the caption of a button or something else in my > own language(Farsi), in the design mode it shows the correct string > but when I compile it it shows a '?' instead of every character. Can > anyone ple...

return int value to OS in MFC App
Hi, Everybody. I have to make A MFC app to return int value to Operatiing System.. if i could use WinMain() function, this is not matter. but MFC does not reveal WinMain().... How can i solve this problem? Can Anybody help me with this problem? <flybluewing@bcline.com> wrote in message news:1189386249.923483.59250@y42g2000hsy.googlegroups.com... > Hi, Everybody. > > I have to make A MFC app to return int value to Operatiing System.. > > if i could use WinMain() function, this is not matter. > but MFC does not reveal WinMain().... > How can i solve this problem?...

mfc and IE activeX
I'm using VS 2003 and trying to use Internet Explorer in my MFC application but encountering problems If I built a very simple test dialog-application and drop in the IE it works exactly as expected. However, when I create a similar dialog box in my MFC application and call the ...DoModal() nothing appears at all - not even the dialog box itself. It's as if my application does not want to use ActiveX components - I also tried a couple of other Microsoft ActiveX controls and they have the same problem. I must be missing something obvious - any one with any ideas will be much ...

How do I copy previously entered data
If I enter related data in A1 and C1 and then type the same data as A1 in A4, how do I get the data in C1 to automaticallyh appear in C4? Hi =VLOOKUP(A4,A1:C3,3,0) -- Regards Frank Kabel Frankfurt, Germany Snoopy wrote: > If I enter related data in A1 and C1 and then type the same data as > A1 in A4, how do I get the data in C1 to automaticallyh appear in C4? Hi Frank, Thanks for the information, I tried it and it works. One further question if I may? If I type the info in A1 in multiple places in columnA, can excel be configured to repeat the related info in c1 in the cor...

2 up A5 publications on A4 and merging data
I have prepared an A5 Identity Card two up on A4 size in Publisher. I have attached a database of names and information putting the fields where I need them. When previewing I am getting the same details for the same person for both copies - in other word the same card twice for each entry on the database. I know in Word that there is a way of having, say, la sheet of abels with different information on each individual label. Can a similar effect be achieved in Publisher? Are you looking at print preview? This is a bug, all entries will appear to be the same. Otherwise, be certain ...

Has my subreport go data in it or not?
Hi I am printing a report of Items Ordered in response to a mailshot. If there are any Advance Orders for books not yet in print, a subreport is included with the detail line. I am then trying to add the total of books ordered to the total value of advance orders. Can I tell from my main report if my subreport has data in it? I have tried using IsNull on one of the fieldnames, but I get #Error or #Name. Stapes Test the HasData property of the report in the subreport control. Details in: Bring the total from a subreport onto a main report at: http://allenbrowne.com/casu-18.html --...

Need Help with MFC!!
Hi all, need help esp. with Graphic part. When you right click on any drive on your machine and click properties, you get a tabbed dialog. I want to know how can I embed graphic image (pie chart) into my MFC Dialog? I have written code which displays the Disk Usage right now but don't know how to display that info as a PIE CHART!!!!!! besides what type of MFC Dialog application should I look fwd to build? I want exactly as the DRIVE properties. TIA -- ======== Regards Vai ======== Have you looked at the CDC::Pie method? joe On Wed, 12 May 2004 23:07:11 -0400, "Vai2000"...

Numbering data pairs
I have a spreadsheet which I use to plot custom contour shapes. What I am hoping for is if someone can tell me how to go about adding the following information to the graph. My xy coordinates are easy enough to display if I need to, but what I really need is to display the numbered point. ie point xy1 should display 1, point xy2 should display 2, etc... I played around with this for a while and couldn't figure it out and the help file was, well, no help at all. Maybe I'm just dumb as a brick but I just figure out the answer. If anyone can help I'd be most obliged. Thanks AJ...

Problem with creating two variable data table
Presently I am unable to set up a formula in a cell for two inpu variable. I have gone through EXCEL help on how to create two variabl data table but unable to do so. There may something wrong in formula. I have done the following : Inserted a formula in cell D20 which read as : D21^2+E20^2-4. Keyed in a set of inputs in same column below the cell in which formul is written i.e. D21:D26 and keyed in another set of input in same ro in the cell that is at the right of formula cell i.e. E20:J20. Always one message comes "Input cell reference is not valid". Ther must be something wro...

MFC to Console.
Hello Group. I need to convert the code of WiniNet Async Demo from microsoft samples from MFC to a console function.. Someone can help me with the changes.. The code is posted here Regards /* Microsoft Corporation Copyright 1999-2002 */ /******************************************************************** ProjectName : AsyncDemo Purpose : This sample demonstrates how to submit two WinInet requests, using InternentOpenUrl, asynchronously. Notes : This sample does not handle any authentication. To properly handle authentication, the functions that handle specific protocols (like Ht...

XML and MFC
Hello guys, What source of knowledge would you point me to if you were about to integrate XML with MFC? Of course if there's any Microsoft documentation anywhere, please post me a link to it. Thank you in advance! :-) Yea, I wanna know it too. Who would give a hand? > What source of knowledge would you point me to if you were about to > integrate XML with MFC? Of course if there's any Microsoft documentation > anywhere, please post me a link to it. After digging left and right, I remained with two main options: - MSXML - MS, proprietary, COM, with all the implications:...

Macro to insert cells and copy/paste data
I have 2 tables side by side in a spreadsheet. I need to compare the 2 tables and if the names, departments etc appear in table 1 (on the left) but not in table 2 on the right I need a macro to insert cells in table 2 at the appropriate position and then copy the info from table 1 and paste it into the newly inserted cells in table 2 on the right so that both tables have the same values in the same rows. The length of the tables could vary from 20 rows to 3000 rows and may not always be in the same location (cells) when I receive them so the macro would need to be "relative" Any h...

Sending Window Messages from an MFC app to a Windows Firm tray application
Hello, I have an MFC MDI application and a Windows Forms (2.0) Tray Icon application. I want to run a command on the tray application via my MFC application. There is a "Register" context menu command on the tray icon application. I want to call the Register command from my MFC MDI application. I thought of a windows message. How do I do it? Is there any other better mechanism to do so? Thanks, Janiv Ratson. If you know the class of the window on the tray application you can use FindWindow() to get the window for the class. Then you can use either PostMessage() or SendMessag...

Data Migration Wizard for Microsoft Office Outlook with Business C
Is there anyone, who have experience, in using the "Data Migration Wizard for Microsoft Office Outlook with Business Contact Manager" to import data to Microsoft CRM? My question is primary, if it is simple to use the tool and if all information can be imported? Best Regard CD You use the Data Migration Wizard to picks up csv files, generate the data maps from the csv sample files and import/export data & data maps. you can use the tool from within outlook 2007 which is the one you have i assume. Yet, if you want to synchronise your contact list with CRM then you ...

Strange data entry behavior
Helping a friend sort this problem.... Type a whole number in a cell, hit enter, and it appears there and in the edit bar divided by 100, viz 436 shows (and calculates) as 4.36 Enter a number with a decimal and there's no problem. The cell formatting is OK; the regional settings are correct; when the sheet is transferred to another PC the numbers appear correctly. This happens in every new worksheet. Any ideas? Ern, Tools - Options - Edit. Uncheck Fixed Decimals. -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "Er...

dynamically managing of layout in MFC + GridBagLayout in MFC or C++
Hi, can anybody tell me how can I make or find a function in MFC to manage layout of a dialog that dynamically has been create and also the controls in the dialog? I am new in MFC, what I am lokking for is something like GridBagLayout in java? is there something like this in C++ MFC ? any idea plz? Thank u There is nothing like GridBagLayout in MFC. However, you can achieve the same functionality thru various means. You have to move the controls manually on resize of the dialog or window. Please see the following examples: http://www.codeproject.com/dialog/easysize.asp http://www.codepr...

how to creat text box to enter data in the form
I try to create a form where i would enter the id and it will look up the table and find recod/records with that id. In the database window, select the table so that it is highlighted. Click on the symbol for AutoForm on the toolbar, (me copy of Access 2003 is down RHS of toolbar) The form will open with textboxes on it. Jeanette Cunningham "AShi" <AShi@discussions.microsoft.com> wrote in message news:D522EE2C-4D88-4B89-9B1A-7D22C41F0380@microsoft.com... >I try to create a form where i would enter the id and it will look up the > table and find recod/records with t...

CRM 4.0 Data Migration Manager #2
Hi; Does anyone know the prerequisites for installing the DMM? I have a 2-box deployment, CRM and SSRS on one server, SQL database on the other server. I have installed DMM on the the CRM server (selected to use the existing SQL installation as opposed to using sql express), but it dies when I try to log in (during the synchronication process) - it's complaining that it can't find/run a DTS file. Given that the file its looking for is there and I have full privs, I'm assuming it just doesn't know what to do with the file. Do the SQL Workstation components need to be i...

Console output from MFC dialog based app
Dear All, I have developed a MFC dialog based application. Now when I execute this app from command prompt, I need to write some text back to console. In console application we achieve this using functions like printf(), puts(), etc. Please let me know how do I achieve same in dialog based application since printf() and other functions are not working here. Thanks, Ajay You can't write to the same console window that you were ran from, but you can create a console window and write to that. Take a look at AllocConsole, ReadConsole, and WriteConsole. Here is an example: http://www....