C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem in formatting query!!!! Help needed...

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Wallace
Guest





PostPosted: Sat Jun 17, 2006 9:10 am    Post subject: Problem in formatting query!!!! Help needed... Reply with quote



Hai All,

I have a problem in formatting a query...

sprintf((char*)szSqlStr,"INSERT INTO
ins(version,art,lobenr,rondetyper,tekst,font) VALUES
('%s',%d,%d,%ld,'%s','%s')",buff, art, lobenr, rondetyper, tekst,
font);

buff is char array
art is int
lobenr is short
rondetyper unsigned long
tekst char array
font char array

When I run this query( retcode = SQLExecute(hStmt) ), it is returning
-1.
But when I run the same query but giving hard coded values to these
variables, it is getting inserted into DB.
Dont know whether the problem is in formatting or some other..
Help needed!!!
Looking forward for the response..
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.