Caveat: I'm not a seasoned Borland C++ builder programmer so this may very
well be just plain stupidity on my part (I'm not even a really good C
programmer either !).

However, givem some code that looks  similar to this:

  int state;
  MYSQL_RES *result;
  MYSQL_ROW row;
  char sql[250];

  sprintf(sql,"%s%s%s%s","SELECT positionID
                            FROM reflectivity.positions
                           where position_row = ",position_row,
                            " && position_column = ",position_column);
  state = mysql_query(connection,sql);
  if (state != 0)
  {
    printf(mysql_error(connection));
    return 0;
  }
  result = mysql_store_result(connection);
  // while ((row = mysql_fetch_row(result)) != NULL)
  row = mysql_fetch_row(result);

  if (mysql_num_rows(result) > 0)
  {
    // free some memory
    mysql_free_result(result);
    return (int)atoi(row[0]);
  }
  else
  {
    // free some memory
    mysql_free_result(result);
    return 0;
  }

in C using gcc on linux it works.  I return a valid int which corresponds
to the database entry, no warnings, no errors that I can see.

In Borland C++ Builder, although I connect to the database (ie, I can
WRITE fine to the databsae, and, there are no complaints by my connection
to the database), and "if (mysql_num_rows(result) > 0)" returns true
(meaing it sees the row(s)), I get:

raiased EXCEPTION CLASS EAccess Violation with message Access Violation at
address 3256EEFF in module cc3250mt.dll read of address FEEFEE. Process
stopped.

row[0] however does NOT match against NULL or \0 (though if I print it out
it shows "")

When I attempt to reference or work with row[0].  This has been the case
whenever I try to read an element in row under Borland (various other
functions as well) whereas the exact code (in all instances) works fine
when compiled with gcc.  Again though, any WRITES to the database work
great under Borland (so I don't think it's a connection issue).

Am I just totally missing some boat here?

Thanks for any help!

Seth


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to