Problem creating a populated ado recordset



Hello,

I'm creating an ADO recordset and having problems with the result returning
a recordset without data. If the sql statement contains "SELECT *" then a
recordset is not created; rst.eof = TRUE. However, if I limit the select
statement to four fields it returns a recordset with data; rst.eof=false.
Selecting more then four fields will cause no data to be returned. Any
sugestions?

Below is the code i'm using... I've also tried setting the
cnn1.commandtimeout = 100000. Still having same problem.

Dim cnn1 As ADODB.Connection
Dim rst As ADODB.Recordset
Dim strCnn As String
Dim sql As String

Set cnn1 = New ADODB.Connection
strCnn = "Provider=vfpoledb;" & _
"Data Source=\\Sbtserver\pag\pro30\prodata.dbc; Collating
Sequence=MACHINE"

cnn1.Open strCnn

Set rst = New ADODB.Recordset
Set rst.ActiveConnection = cnn1

With rst
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
End WIth

sql = "SELECT *" & _
" FROM icitem01 WHERE Item = 'HF02-00856786'"

rstNote.Open sql


I must limit the select statement to a max of four fields to get a recordset
populated with data returned. IE. Select field1, field2, field3, field4 FROM
.... Wierd.

Thanks in advance!

.



Relevant Pages

  • Re: Find code errors
    ... Dim rst As ADODB.Recordset ... Dim strCriteria As String ... 'opens recordset to support all cursor and record movements ...
    (microsoft.public.access.macros)
  • Re: Saving rtf to SQL Column
    ... Dim cn As ADODB.Connection ... Dim Sql As String ... ' and use the stream code to stuff a text or ... Now all I get is an error saying the recordset does not support updating. ...
    (microsoft.public.vb.database.ado)
  • Re: SQL Update Issue
    ... If you want to drop the SQL, here is the sample using recordset method. ... Dim con As New ADODB.Connection ...
    (microsoft.public.access.formscoding)
  • Re: vba SQL not equalling query in Access
    ... Dim rst As Recordset ... I copied the SQL from the SQL view of the query. ... How are you counting the number of records in your recordset? ...
    (microsoft.public.access.queries)
  • Re: using LIKE operator in SQL
    ... Dim rst As Recordset ... Dim rst As DAO.Recordset ... it's lower in precedence than ADO. ... There's a Recordset object in both the ADO and DAO models. ...
    (microsoft.public.access.queries)