Hi
I am setting up a big web shopping cart with Mysql PHP Apache Quickbook and QODBC.
Shopping cart in php running fine it gives and takes data from qodbc no problem.
now i had a problem that some manual data will be inserted in to quickbooks directly
i have developed a updated which will go and check quickbook every 10 mins and if any new data found i am updating the mysql so that some one can track there order online doesn't matter where they are.
every thing was going on plane web is working fine. my setting for qodbc is = not optimized, multiuser mode, company file located, dcom server turned on.
when i run the C# App what happens is i runns fine but once it finish it work and clost the connection the web pages are not able to connect at all. they are not giving a connection error or any error at all just try and never fails. any idea why this is happing.
this is my c# app code to connect.
[STAThread]
public DataTable getQdata(string date)
{
DataTable result = new DataTable();
OdbcDataAdapter dAdapter = null;
try
{
OdbcConnection con = new OdbcConnection("DSN=" + Settings.Default.DNS + "");
con.Open();
dAdapter = new OdbcDataAdapter(
"SELECT TxnId, TimeCreated, RefNumber, PONumber, CustomerRefFullName, " +
" ShipDate, DueDate, ShipMethodRefFullName, IsPending, Tax1Total, Subtotal " +
"FROM Invoice " +
"WHERE TimeCreated > {ts '" + date + "'}", con);
dAdapter.Fill(result);
con.Close();
}
catch (Exception ex)
{
try
{
log.writeLog("Error While Getting Data From QuickBook"
+ ex.Message + Environment.NewLine + dAdapter.SelectCommand.ToString());
}
catch (Exception newEX)
{
log.writeLog("Error While Getting Data From QuickBook"
+ newEX.Message + Environment.NewLine);
}
}
return result;
}
this is my php code to connect
if($oConnect = odbc_connect("QuickBooks Data", "", "")) {
//customer listID is quickbook $CustomerRefListID = $row['CustomerRefListID']; $query2 = "SELECT name FROM Customer where ListID = '$CustomerRefListID' "; $result = odbc_exec($oConnect,$query2); $row = odbc_fetch_array($result,0); if($row['name'] != '') { odbc_close($oConnect); return true; } else { return false; } odbc_close($oConnect); } else { return false; }
any idea at all ????
|