Skip to Content.
Sympa Menu

freetds - [freetds] tds_submit_query allways returns TDS_SUCCEED

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James Reed" <t519008_new AT hotmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] tds_submit_query allways returns TDS_SUCCEED
  • Date: Mon, 20 Oct 2003 09:22:39 +0000

Hi

I am new to freeTDS (which is a really great package by the way!!!) I have just put together a simple test program using some of the stuff from the unittests catalog. It seems that I allways get TDS_SUCCEED back from the tds_submit_query. I am guessing I must be doing something wrong since it seems freeTDS is so well tested. I have a database with a table="test" that I am testing with. If I change the INSERT to "INSERT INTO crap VALUES ('%s')" then I still get TDS_SUCCEED,,,,and I dont have a table named crap ;)

Thanks
James

P.S. I am running on a Solaris system and my database is a MS SQL 7.0 database.

Here is my test program:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <tds.h>
#include "common.h"
#include "testakonv.h"


main(int argc, char** argv)
{
printf("start");

TDSLOGIN *login;
TDSSOCKET *tds;
int ret;
int verbose = 0;
char testInsert[1000];
char test[1000];

sprintf(test,"testakonv");
printf("%s: Testing login, logout\n", __FILE__);
ret = try_tds_login(&login, &tds, __FILE__, verbose);
if (ret != TDS_SUCCEED) {
printf("try_tds_login() failed\n");
return 1;
}

sprintf(testInsert,"INSERT INTO test VALUES ('%s')",test);
int rc = run_query(tds, testInsert);
if (rc != TDS_SUCCEED) {
printf("error in INSERT=%d",rc);
}
else
{
printf("command=%s, successful rc=%d",testInsert, rc);
}

try_tds_logout(login, tds, verbose);
printf("Exiting main process");
exit(0);
}

_________________________________________________________________
Se hva du og andre tjente i 2002 http://money.msn.no/ Sjekk skatten nĂ¥





Archive powered by MHonArc 2.6.24.

Top of Page