From: Steven Schoch Date: September 22 1999 4:45pm Subject: Re: Question on iodbc/myodbc List-Archive: http://lists.mysql.com/myodbc/710 Message-Id: <37E907B9.978B24DB@starnet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Federico Balbi wrote: > > /* the insert statement */ > > sprintf(query,"INSERT INTO prob_entry VALUES > > (%d,'%s','%s','%s','%s','%s','%s','%s','%s','%s')", > > problem.prob_num, > > problem.prob_desc, > > problem.prob_type, > > problem.username, > > problem.useremail, > > problem.telephone, > > problem.timeentered, > > problem.closed, > > problem.prob_user, > > problem.prob_short_desc); > > > > rc = SQLExecDirect(hstmt, query , SQL_NTS); > > check_return (rc, henv, hdbc, hstmt); > > > > Hi, I use VisualC++ and MySQL and upto now did not have problems. > did you try to make a query manually and see what happens? > try build the final string without sprint and see what happens... > sometimes (",',%) act weird in MySQL. It is wise to not assume the table will always have the columns in the same order. Change your query to this (assuming your column names are the same as the fields in your structure): sprintf(query,"INSERT INTO prob_entry (prob_num, prob_desc, prob_type, username, useremail, telephone, timeentered, closed, prob_user, prob_short_desc) VALUES (%d,'%s','%s','%s','%s','%s','%s','%s','%s','%s')", -- Steven Schoch StarNet Communications Corp. 1270 Oakmead Pkwy. #301 Sunnyvale, CA 94086 +1 408 739-0881