VD and ACCESS give different results 
Author Message
 VD and ACCESS give different results

vb is returning 1 record.  ACCESS is correctly report 2 records.  i need the
VB to work.  please help!!!!
i have reference DAO 3.5...

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim retVal As Integer
'Retrieve the dates of all survey submitted for this employee
Set db = DAO.OpenDatabase(gDBPath & "\employeereview97.mdb")
'set the sql string
strSql = "SELECT tblEmployees.LastName, tblEmployees.FirstName,  " & _
    "tblEmployees.MiddleName,  tblEvaluations.EvaluationDate " & _
    "FROM tblEmployees LEFT JOIN tblEvaluations ON " & _
    "tblEmployees.EmployeeID = tblEvaluations.EmployeeID " & _
    "WHERE left(tblEmployees.LastName, 2) like '" & Left(txtLastName.Text,
2) & "'"
Set rst = db.OpenRecordset(strSql)
retval  = rst.recordcount

Left(txtLastName.Text) would return say "br" for brown
rst.recordcount from VB returns 1 employee
rst.recordcount from ACCESS correctly returns 2 employees

can anyone tell me what's wrong.
thanks in advance,
allen



Wed, 27 Nov 2002 03:00:00 GMT  
 VD and ACCESS give different results
Recordcount does not return a reliable count of records without a MoveLast.

--
Brendan Reynolds


Quote:
> vb is returning 1 record.  ACCESS is correctly report 2 records.  i need
the
> VB to work.  please help!!!!
> i have reference DAO 3.5...

> Dim db As DAO.Database
> Dim rst As DAO.Recordset
> Dim retVal As Integer
> 'Retrieve the dates of all survey submitted for this employee
> Set db = DAO.OpenDatabase(gDBPath & "\employeereview97.mdb")
> 'set the sql string
> strSql = "SELECT tblEmployees.LastName, tblEmployees.FirstName,  " & _
>     "tblEmployees.MiddleName,  tblEvaluations.EvaluationDate " & _
>     "FROM tblEmployees LEFT JOIN tblEvaluations ON " & _
>     "tblEmployees.EmployeeID = tblEvaluations.EmployeeID " & _
>     "WHERE left(tblEmployees.LastName, 2) like '" & Left(txtLastName.Text,
> 2) & "'"
> Set rst = db.OpenRecordset(strSql)
> retval  = rst.recordcount

> Left(txtLastName.Text) would return say "br" for brown
> rst.recordcount from VB returns 1 employee
> rst.recordcount from ACCESS correctly returns 2 employees

> can anyone tell me what's wrong.
> thanks in advance,
> allen



Wed, 27 Nov 2002 03:00:00 GMT  
 VD and ACCESS give different results
In reference just to the title, I'd never really put the two together.

Except possibly in the case of Access 2000: "Would you prefer to
develop in Access 2000 or have a good case of the ...., Sir?"

--
 L. M. (Larry) Linson
  Access example databases at http://homestead.deja.com/user.accdevel
  New: Book reviews, previously published in North Texas PC News
  Script execution must be enabled and Windows set to Small Fonts

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



Wed, 27 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. LIKE query gives different results in Access 2000 and VB6 SP5

2. 97 gives different result to 2000

3. Dir$ function and Dir listbox gives different results

4. BitBlt give me different result on some computers

5. Native code results different from p-code results

6. SQL select different results on different forms

7. cr6 prof - different printers = different results

8. Different query results in Access 2000 than in VB

9. Quereies Return Different Results ADO vice Access

10. ??? Result of a Query into different Access 2.0 database

11. HELP...Queries return different results in VB than Access

12. HELP ! Access and VisData Give different answer

 

 
Powered by phpBB® Forum Software