Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to expand this query that gets document types

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-03-03 : 14:10:41
We have this issue. some of our customers can NEVER see the purchase order but others can ( we are brokers and finance their purchase so we don't care). these are known as GP customers. Invnum is the name for all docs something in Great plains.

Now, for those who CANNOT see the PO, they CAN see 2 docs, Quotes, and 'Packing Slip'. now the way it works, the Document storage company server can offer ALL of the docs thru their process but we want to limit this, the following query we do, can it say, 'if the customer is GP, give me the QUote AND the Packing slip.' currently it asks for one type only, can we add a AND for such customers? here u have the code:

if (docs.Length > 0)

docQueryString += " AND [" + docs[0].DocumentTypeLabel + "]=\"" + invNum + "\"";

/* }*/

byte[] b = System.Text.UTF8Encoding.UTF8.GetBytes("[DELIVERY_DATE]>\"11-15-2010\"" + docQueryString);



tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-03 : 14:28:49
This doesn't answer your question, but I wanted to mention that your query is vulnerable to SQL injection. Why aren't you using parameterized queries?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-03-03 : 14:43:21
this is done in the code and then it gets encrypted with a 'passphrase' and sent to the server, to get the docs. I thought the encrption was the cure.
Go to Top of Page
   

- Advertisement -