Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,409 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,465 people online right now. Registration is fast and FREE... Join Now!




C1004: unexpected end of file found

 
Reply to this topicStart new topic

C1004: unexpected end of file found, C1004: unexpected end of file found

straygrey
15 Oct, 2008 - 12:50 AM
Post #1

New D.I.C Head
*

Joined: 4 Oct, 2008
Posts: 7


My Contributions

I am attempting to get my old brain around Visual Studio .Net and have produced the following code but cannot get it to build. .Net returns C1004: unexpected end of file found.
CODE


#include "stdafx.h"
#include <ocilib.h>

#using <mscorlib.dll>

using namespace System;

int _tmain(int argc, char *argv[])
    {
    OCI_Connection* cn;
    OCI_Statement* st;
    OCI_Resultset* rs;
    int Counter = 0;
    int ret;
    FILE *TablesFile;
    char *Database, *UserName, *UserPassword, *StartDate,*EndDate;
    char Message[256] = "";
/*    for (i=0; i<argc; i++)
*        {
*        printf("%d %s\n", i, argv[i]);
*        }
*/

    Database = argv[1];
    UserName = argv[2];
    UserPassword = argv[3];
    StartDate = argv[4];
    EndDate = argv[5];
    OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT);
    
    cn = OCI_ConnectionCreate(Database, UserName, UserPassword, OCI_SESSION_DEFAULT);
    st = OCI_StatementCreate(cn);
    sprintf(Message, "select MemNumber,Turnover from (select  mem_number MemNumber,sum(trans_turnover) Turnover from members join transact on mem_number = trans_code where Trans_date between '%s' and '%s' and mem_barred = 0 group by mem_number order by turnover desc ) where rownum <=200", StartDate, EndDate);
//    printf("%s\n",Message);

    OCI_ExecuteStmt(st, Message);
//    OCI_ExecuteStmt(st,"select MemNumber,Turnover from (select  mem_number MemNumber,sum(trans_turnover) Turnover from members join transact on mem_number = trans_code where Trans_date between '01-Jan-2004' and '14-Oct-2008' and mem_barred = 0 group by mem_number order by turnover desc ) where rownum < 201");
    rs = OCI_GetResultset(st);
//    printf("OCI_GetResultset() returns rs = %x\n", rs);
    TablesFile = fopen("Tables.html", "wt");
    while (OCI_FetchNext(rs))
        {
        fprintf(TablesFile, "% 4d - %u\n", ++Counter, OCI_GetDouble(rs, 1));
        }
    ret = fclose(TablesFile);
    OCI_Cleanup();
    return EXIT_SUCCESS;
    }



and as hard as I look I cannot see a missing or additional brace.

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/2/08 12:20PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month