Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : C# App And PHP having TroubleSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v7 Forum

 New Topic 
 
 Post Reply 
[1]  
 C# App And PHP having Trouble 
 Author   Message 
  Shanewaj 
  
 Group: Members 
 Posts: 22 
 Joined: 2007-09-24 
 Profile
 Posted : 2008-05-12 10:27:38

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 ????

 

 

 

 
Md Shanewaj Rahman
Software Developer
Nulab Professional Imaging Pty. Ltd. 
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-05-12 12:47:59

Try setting up a new system DSN for the C# desktop app only to use in Settings.Default.DNS, make sure that "Use DCOM Servers" is unchecked.

See: How do I create or configure a QODBC DSN? for more.

 

  Top 
  Shanewaj 
  
 Group: Members 
 Posts: 22 
 Joined: 2007-09-24 
 Profile
 Posted : 2008-05-12 14:04:41

Hi

Thanks I have tryed to create a separate DNS,

Separate User in Quickbook

But still don't work. I have tryed with optimized and not optimized.

any more ideas ??? or I will say once i have run

It works fine with VB demo. As if i am running VB demo and Web page same time works

after i close down VB demo works.. but when i try to run my C# app while the app is connected it works fine then when it finish it query i am closing the connection then the web pages stop working.

any other idea

 

 
Md Shanewaj Rahman
Software Developer
Nulab Professional Imaging Pty. Ltd. 
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-05-13 10:29:45

Make sure your C# application QODBC connection string has a UseDCOM=N (like VB Demo is doing).

For example this ASP.NET application uses UseDCOM=Y :

<configuration>
    <connectionStrings>
        <add
            name="QODBCDataConnectionString"
            connectionString="DRIVER={QODBC Driver for QuickBooks};DFQ=D:\Data\em1996.qbw;SERVER=QODBC;UseDCOM=Y;OpenMode=F;"
            providerName="System.Data.Odbc"
        />
    </connectionStrings>
</configuration>

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to