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 : Custom Fields updateSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Custom Fields update 
 Author   Message 
  Duane Christie 
  
 Group: Members 
 Posts: 7 
 Joined: 2008-06-03 
 Profile
 Posted : 2008-09-05 22:50:08

I am using QuickBooks Enterprise 8.0 USA.  We have created a custom field to store social security numbers for our customers.  We have to have this information to do 1098 forms.  The problem is we can't insert into the custom field, we can only update.  What I am doing is pulling the customer info from our main system, and then inserting them into QuickBooks.  Once I insert a new student, I then have to do an update based off of the name.  The problem is it is taking a good minute per student.  We have over 1000 customers in the system now, and that number will continue to grow exponentially.  If we are already having problems now, I can only imagine this will get worse as time goes on.  Can I create an index on the customer table, and if so, how do I go about creating it?  Below is the code I use to insert the customer:

str_Sql_Comm = "Insert into Customer(Name,LastName,FirstName,BillAddressAddr1,BillAddressCity,BillAddressState,BillAddressPostalcode,Phone,AccountNumber)Values('" + drow_Insert[1] + "','" + drow_Insert[2] + "','" + drow_Insert[3] + "','" + drow_Insert[6] + "','" + drow_Insert[7] + "','" + drow_Insert[8] + "','" + drow_Insert[9] + "','" + drow_Insert[5] + "', '" + drow_Insert[0] + "')";

OdbcCommand com_Qb_Insert = new OdbcCommand(str_Sql_Comm, con_QuickBooks);

com_Qb_Insert.CommandType = CommandType.Text;

com_Qb_Insert.ExecuteNonQuery();

I then do an update with this code:

str_Sql_Comm1 = "Update Customer SET CustomFieldSSN = '" + drow_Insert[12] + "' WHERE Name = '" + drow_Insert[1] + "'";

OdbcCommand com_Qb_Insert1 = new OdbcCommand(str_Sql_Comm1, con_QuickBooks);

com_Qb_Insert1.CommandType = CommandType.Text;

com_Qb_Insert1.ExecuteNonQuery();

Any help would be appreciated. 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-09-06 08:53:07

The problem is Name doesn't have an index (jump-in), you need to use:

str_Sql_Comm1 = "Update Customer SET CustomFieldSSN = '" + drow_Insert[12] + "' WHERE FullName = '" + drow_Insert[1] + "'";

Running:-

sp_columns Customer

will show you what indexes are available.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to