VB6/ADO/SQL Server 6.5 problem with DISTINCT?

VB6/ADO/SQL Server 6.5 problem with DISTINCT?

Post by rmarksm.. » Tue, 18 Apr 2000 04:00:00



I a VB 6 app I am writing, I use the following code:
SELECT DISTINCT
  DW_Employees_V.EmployeeName , GEN_SystemEngineers.EmployeeNumber
FROM
  GEN_SystemEngineers INNER JOIN  DW_Employees_V ON
  DW_Employees_V.EmployeeNumber = GEN_SystemEngineers.EmployeeNumber
WHERE
  GEN_SystemEngineers.PlantID = '0780' and
  GEN_SystemEngineers.AssetCode = '0781'

Using the query tool, this works fine, thank you very much (one name,
one empID, sorted by name) (Also works the same in Access  ;-)  )

But, as soon as I include the code in my VB app,:
1) the DISTINCT keyword is ignored, and
2) the results are not sorted by name.

Any ideas why this is happening?  I'm not sure how to verify what
version of ADO (although I'm pretty sure it's 2.x), etc., I have
running on the server.

MANY thanks to all responders.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Problem usind ADO VB6 x SQL 6.5

Hello,

I'm using a IIS server to connect my databases and I'm having the following
troubles:

1) I can't identify what connection each user is using, because IIS opens 3
connections on SQL and all connections are made by this channel. Can I
change this?

2) Sometimes a connection is locked by another. How all clients use the same
connections my programs runs to crash and sometimes some written data are
rolled back. I tried to change the query timeout on the web server, but the
results were worst.

3) Sometimes a open a transaction, update a record and when I try to commit,
a receive an error that there's no begin transaction corresponding to the
commit. The transaction is made in VB.

My configuration is:
VB6 SP 3
SQL 6.5 SP5
Ado 2.1 SP2
commandtimeout = 3000 (when openning connection)
querytimeout = 1200 (IIS server)

Does anybody knows how solve this problem?

Thanks,

Edilson.

2. PdoxWin - Report Des. Problem

3. SQL Server 6.5 & VB6 ADO

4. Implementing "no changes" in database column data

5. VB6.0 to SQL server 6.5 connectivity problem

6. TechTips: A matter of sorts ...

7. Update problem with VB6 and SQL Server 6.5

8. How to create a dBase-Browser?

9. migrating sql databases sever 6.5 from sql server 6.5 to another sql server 6.5

10. VB6: Oracle 8/SQL Server 2000 compatibility problems using ADO 2.5 and SQL

11. VB6: Oracle 8/SQL Server 2000 compatibility problems using ADO 2.5 and SQL Syntax

12. sql 6.5 ado using vb6 trusted connection failure