CRecordset getting ambiguous column error upon SQLGetData to SQL Server 2000

I have a CRecordset with the following SELECT statement used for opening the initial query:
CString CEmailList::GetDefaultSQL()
{
    return _T("SELECT el.CompID, el.Email, Subject, el.FormID, Field0, Field1, Field2, Field3, 
Field4, Field5, Field6, Field7, Field8, Field9, Attachments, Attachment, FormDocument")
           _T(" FROM [dbo].[Email_List] el")
           _T(" LEFT OUTER JOIN [dbo].[Email_Forms] ef ON (ef.FormID=el.FormID)")
           _T(" LEFT OUTER JOIN [dbo].[Email_Attachments] ea ON (Attachments=1 AND 
ea.CompID=el.CompID AND ea.Email=el.Email)") ;
}

The FormDocument field is "image" type, which is late-bound to a CLongBinary.  During the attempts 
to retrieve the current row value of FormDocument (in the fixups pass of 
CEmailList::DoFieldExchange), a call to SQLGetData is made.

For some reason, the SQLGetData call doesn't recognize that I have used table qualifiers to 
disambiguate the CompID, Email, and FormID fields, and returns an error that these columns are 
ambiguously named (they all exist in two of the three tables joined).  If I instead change the 
statement to use aliases for these column names, I get a S0022 invalid column name error, as it 
doesn't recognize the aliases either.

What's the work-around or solution to this problem?

 


0
ScotB (233)
2/4/2007 12:56:22 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
546 Views

Similar Articles

[PageSpeed] 49

Reply:

Similar Artilces:

Crash on 'Send"
My wife's Intel Celeron running ME started having this problem sporadically - now constantly. Outlook 2000 receives OK - everything seems fine until you hit the 'Send' button then Outlook crashes giving an error message that says 'Outlook has caused an error in <unknown> and has to shut down. If the problem persists you may have to restart your computer.' Re-starting however has no effect. I have re-installed Office. Used 'Detect & Repair' under the 'Help' tab, and installed all patches/updates from the Office site. But this error continues, now...

Error number: 0x800ccc0e
Why am I getting this right after installing Outlook 2000? It was a gift. I have had no success trying to get info from the knowledge base. Nothing has changed except installing Office 2000. I configured everything just as I had previous. Going back to Outlook Express I get the same error. What is going on? Same story here. And I would love to just be able to go back to OE at this point. Darla >-----Original Message----- >Why am I getting this right after installing Outlook 2000? >It was a gift. I have had no success trying to get info >from the knowledge base. Nothing ...

SQL deadlock problem
I am currently having a big issue with sql deadlocking on the PrincipalObjectAccess table. The last few months I have been working on a synchronization process using a Biztalk orchestration. The sync uses the crm webservices to create and update account and contact records in CRM. But now deployment to the production environment gives me some problems. It seems that when trying to update account records (which is one of the first actions in the sync process) the webservice gives me Generic SQL errors and SQL timeouts. After extensive profiling and tracing in SQL I found that there are...

Error: Invalid byte was found at byte index 63.
Does anyone know what this means: "Invalid byte was found at byte index 63. " If yes, please help. Apogee Apogee wrote: > Does anyone know what this means: > > "Invalid byte was found at byte index 63. " That means exactly what it says: At index 63 XML parser found a byte, which is invalid either according document's encoding or is forbidden in XML documents at all (see list of allowed in XML characters at http://www.w3.org/TR/2000/REC-xml-20001006#charsets) -- Oleg Tkachenko http://www.tkachenko.com/blog Multiconn Technologies, Israel ...

How to keep format when importing Excel into SQL.
Can anybody help me please? When I import Excel file into SQL, a field that formated as 0000000000 (custom), loosing leading zeros. I tried to change data type in SQL after importing. No luck. I appretiate any help. See if using IMEX=1 helps: http://pratchev.blogspot.com/2007/10/importing-excel-data-into-sql-server.html -- Plamen Ratchev http://www.SQLStudio.com Plamen, I tried this, but got an error: "The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered." Thank you very much for looking into this. "Plamen Ratchev" wr...

Error Generating the Offlice Address Book
I have a mixed site with 3 5.5 server and 4 2003 servers. I installed 2003 SP1 a few weeks back and since then I'm having an issue generating my Offline Address Book. Here the event log messages I'm getting. Event ID 9331: OALGen encountered error 80040107 (internal ID 501023d) accessing the public folder store while generating the offline address list for address list '/'. - Default Offline Address List For more information, click http://www.microsoft.com/contentredirect.asp. Event ID 9335: OALGen encountered error 80040107 while cleaning the offline address list public ...

XCH Error 3092, OAB replication
I am getting error 3092 for OAB in Exchnage 2003 (migrated from 5.5) "Error 1129 occurred while processing a replication event. Folder: (3-8) NON_IPM_SUBTREE\OFFLINE ADDRESS BOOK\EX:/o" Tried to delete offilne addressbook and recreate but error has not stopped. Any help will be a great help on where to look to get rid of this issue. Thanks ...

Counting number of X's in a column
I need to sum up the number of "Xs" in a column. I would be extremely grateful if someone could help me with the formula. I cannot seem to get one to work. We are using Excel 2003. Thank you. -- Susie Harris Operations Manager Environmental Education Association of Washington =COUNTIF(A:A,"X") -- HTH RP (remove nothere from the email address if mailing direct) "Susie Harris" <SusieHarris@discussions.microsoft.com> wrote in message news:FFA0FB17-C922-48A8-B3C3-0D487C1E6F6A@microsoft.com... > I need to sum up the number of "Xs" in a col...

Lookup based on criteria in 2 columns
Hi, I am trying to use a vlookup or other function to return the value in the amount column based on the location and date. Here is a sample of my data: Location Date Amount 101 9/15/8 10 101 9/16/8 20 101 9/17/8 15 102 9/15/8 50 102 9/16/8 75 102 9/17/8 67 For example if I wanted to return the amount for location 102 on 9/15/8, what formula would I use? I tried using variations of vlookups but had no luck. Thanks, =SUMPRODUCT(--(A2:A50=102),--(B2:B50=DATE(2008,9,15)),C2:C50) -- Regards, Peo Sjo...

How to restore entire server?
This is a long post. Its that time of year again where I practise some disaster recovery skills. I set up a completely seperate physical network from the production network. Its got one Win2000 server (DC + all the Operations Master roles, DNS, WINS, etc) with SP4 (different AD/DNS root forest) and running Exchange 2000 with SP3 (same org name as production server, admin group, storage group, logical and physical database names, legacyexchangeDN, etc). As a result, I can successfully restore our production Exchange 2000 w/SP3 Storage Group/Information Store database without problems. Outlook...

printing multi page newsletters with publisher 2000
Created a new newsletter in publisher 2000, tried to print it on my Epson Photo R1800 printer which supports up to 13x19 sheet paper and 13"x***' in roll format and could not select a format to print pages 1 and 4 on one side and then 2 and 3 on the other. Downloaded an instruction sheet from Microsoft on printing "two 8.5-by11-inch pages per 11-by-17-inch sheet of paper" It says on "file" click "print", choose a printer that can print on 11x17, then click "Book Printing Option" at the bottom of the dialog box. Problem is this "Bo...

"The connection to the Exchange server is unavailable. Outlook must be online or connected to complete this action"
I have setup a number of user accounts and the relative mailboxes without any problem. However, since this afternoon, if I try and connect to a newly mailbox through the email accounts wizard I get the following error message: "The connection to the Exchange server is unavailable. Outlook must be online or connected to complete this action". This also occurs when I go to File>Open>Other User's Folder... and I try and lookup an existing account/mailbox that I know I have permission to. I know Outlook is connected to the Exchange server (I can ping, send and receive emails) ...

Invalid XML error when I open customization setting
I have a problem when I try to open customization setting after I import an entity. The system errored "Invalid XML" "The XML passed to the platform is not well-formed XML". Please recommend how to resolve this problem. Thanks. ...

How to get rid of personal folders view in nagivation pane with MA
Hi, trying to help a friend who migrated to hosted mail with MAPI. She is running Oultlook 2003 with latest updates. In the navigation there are personal folders and MAPI folders. The personal folders always show at top and expanded, with the MAPI folders below and not expanded. She only wants to see the MAPI folders expanded in the navigation view. I tried deleting the personal folders and it would not let me and it will not let you deliver to MAPI, which I understand why. Does anyone know how to make this happen? Thanks. Is this a hosted Exchange account? You can change the...

"MS Money 2000" mit kostenlosem HBCI-Modul (HBCIFM99) kompatibel?
Hallo, Gruppe, wollte mal fragen, ob das o. g. HBCI-Modul auch mit "MS Money 2000" (also - wenn ich das richtig verstanden habe - mit der letzten deutschen Version von "MS Money" 1999/2000 aus �sterreich/der Schweiz) kompatibel ist. Vielen Dank schon im voraus f�r Eure Hilfe. Gru� Struppi Roughly translated: ------------------------- Hello, Group, I wanted to ask whether the o. g. HBCI module also with "MS Money 2000" (also - if I understood correctly that - with the last German version of "MS Money" 1999/2000 from Austria/Switzerland) is compatib...

Linker Error after upgrade from VC7.1
Hello all, After upgrading a VC7.1 project to visual studio 2005, it failed to build in the release configuration with the follwoing error : 1>nafxcw.lib(winocc.obj) : error LNK2005: "public: class CWnd * __thiscall CWnd::GetDlgItem(int)const " (?GetDlgItem@CWnd@@QBEPAV1@H@Z) already defined in InstallDlg.obj The debug build works fine. The project uses MFC in a static library. Well, after doing some research, it seems that this one is tied to the fact that in a release configuration, _AFX_ENABLE_INLINES is defined, so inline functions are embedded in the .obj file. Sure there...

Unexpected error message on closing an Excel file
Suddenly I am getting the following message when I try to close a workbook: "Your formula contains an invalid external reference to a worksheet. Verify that the path, workbook, and range name or cell reference are correct, and try again" The mysterious thing is that it does not happen consistently and that, after I click OK after the above message, I can still save the file. What might be the cause of this error message and can the "invalid reference" be tracked down using one of the utility add-ins such as J. Walkenbach's PUP? If it only happens when you close ...

"Save" preferences getting lost
List members: I work on long documents and want to save my work frequently. Every time I set the "Save" preference to a brief interval like five or ten minutes, the preferences seemingly resets itself to a default of thirty minutes. I'm using Word 2008 for the Mac on an Intel running 10.6.2. Thanks in advance for any thoughts. - Mark Pavlick Hi Mark: That indicates that your user ID does not have permission to write to the preference file that Word is using, or that something is replacing the preference file. With the help of your System...

Install Exchange 2003 Server on new Hardware with same name
I got a new server to move my Exchange Server Installation. I want to keep the name I'm using now for my Server. Already read TechNet Article "How to Move Exchange Server 2003 to New Hardware and Keep the Same Server Name". Is there anything else that I should be aware of that is not on this TechNet article? I'm using a different Disk Configuration, does this matters? Should this be a smooth process? Thanks for any help you can give. The drive letters MUST match, because the paths of the databases are at the Active Directory. The disks can have different sizes than the or...

error on upgrade: ID 4386
Hello, I am upgrading from DPM 2010 RC to DPM 2010 RTM, 64 bit version, on Win 2008 R2 standard. The RC is working without any issues. The upgrade scenario is supported. At the very end of the process the upgrade fails giving me the following. _____ The SQL Server installation failed because a restart was pending on this computer. Restart the computer and then start DPM Setup again. ID: 4386. Details: Unknown error (0x84be0bc2) _____ Restarting the server does not correct the issue. On the next attempt I am getting the same error message. Where to look for the pending rest...

error 0x800cc0f
i installed windows xp, and i set up all my email accounts. they are all working , except one: i receive 0x800cc0f message, which states that the service has been interrupted, contact your ISP...., but this is not the case, since my internet conneciton is working fine all the account settings are correct I am having the same problem. I have to close outlook and reopen to retrieve all of my messages. Have you found a resolution yet? "Kerstin" wrote: > i installed windows xp, and i set up all my email > accounts. they are all working , except one: i receive > 0x800c...

Mails not appearing in Inbox although on Server and viewable by colleague
Hi all, I have searched the archives and found a few more or less related topics to my problem, but unfortunately none of them helped. Here's my problem: I know that I recieve several mails at a specific time each day. Those mails are sent to a colleague of mine and myself but only he recieves them. My admins looked on the Exchange Server and all say, that they can definetely see these emails in the server logs and that the server delivered them to the right mailbox. If my colleague looks into my mailbox before(!!) I open Outlook, he sees these mails as unread in my inbox. As soon as I op...

DNS Error on Exchange
I am getting the following error on my Exchange server. What is my problem? Thanks. Event Type: Warning Event Source: smtpsvc Event Category: None Event ID: 2012 Date: 1/28/2005 Time: 12:01:53 PM User: N/A Computer: PUMA Description: SMTP could not connect to the DNS server '24.220.0.11'. The protocol used was 'UDP'. It may be down or inaccessible. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Data: 0000: d5 04 00 00 Õ... Is that a DNS server that's configured on your Exchange box? It shoul...

Server-Requested Client Action MoveCopy, Unable to create dest msg.
Help. This error message displays when my user opens Outlook 2002. The only fix I can find is to update my exchange server.. which is already up to date. Any suggestions? ...

Recording Macro Error Message
While recording the macro, I access the cell I need the formula in and write the formula. After writing the formula and hitting ENTER, I receive a microsoft GUI with "Unable To Record", and ackknowledge the GUI by hitting OK. The forluma is written to the cell - all even has the desired result/calculation. When I access the code, the navigation within the worksheet is listed in the code, but the furmula is not listed. I tried exiting the file and trying a second time, yet the same results. How do I "reset" the macro recorder to again begin to record all as...