#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    29
    Rep Power
    0

    Help in Sybase error


    I am executing the sybase query, but it is failed to execute when I am gettint the error by getlasterror I am geting the error as "Cannot create a file when that file already exists."

    elog() function is my local function to print the message in log files..
    Please help ...



    Code:
    	sprintf(pstr,"select status, delivery_mark from tb_comm_order where abwsorderno = %.0lf ",orderNo);
    	
    	elog(pstr,0);
    	
    	dbcmd(dbproc,pstr);
    		
    	if (dbsqlexec(dbproc) == FAIL) 
    	{
    		FormatMessage( 
    						FORMAT_MESSAGE_ALLOCATE_BUFFER | 
    						FORMAT_MESSAGE_FROM_SYSTEM | 
    						FORMAT_MESSAGE_IGNORE_INSERTS,
    						NULL,
    						GetLastError(),
    						MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
    						(LPTSTR) &lpMsgBuf,
    						0,
    						NULL 
    							);		
    			
    		sprintf(lv_log,"getFNOOrderStatus [%s]",(char *)lpMsgBuf);
    				return(0);
    	}
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,387
    Rep Power
    1871
    So what is your "C / C++ / C#" question?

    Your issue seems to be with your choice of database API, not some incidental match-up of the programming language you chose.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    29
    Rep Power
    0
    I am using C,actually the problem is the dbinit() is been failed, I dont know why?,I had included the librarys for sybase,
    still the same error message


    Code:
    if (dbinit() == FAIL)
    	{
    
    		return (0);
    	}
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    29
    Rep Power
    0
    Its problem is solved, actually the enviroment variable was not set for sybase

IMN logo majestic logo threadwatch logo seochat tools logo