Re: Problem creating a populated ado recordset



> With rst
> .CursorLocation = adUseClient
> .CursorType = adOpenDynamic

You won't get it.
All client-sided cursors are adOpenStatic regardless of what is asked for.
Only server-sided cursors are the full range (and it depends on database as
to what is supported)
ADO will change CursorType and LockType into something else if what is
requested is not supported
_AFTER_ a successful Recordset Open, check these properties to see what you
actually got.

> rstNote.Open sql

How does ADO know what the 1st parameter is? It has to guess.
You get fractionally better performance if you describe it.
Make sure you supply the 5th parameter which describes the 2nd parameters
argument. Should be adCmdText.
Open() is _THE_ most important call of a recordset.
Properties of Recordset directly depend on combination of Open() parameters
Don't allow default arguments.

> 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.

"*" as in "SELECT *" will return all fields from table icitem01, regardless
of number of fields in table.
Whether you get records depends on your WHERE clause, not the number of
fields.
Also bear in mind

(i) If you have SQL reserved names as fields, you must use square brackets.
So

sql = "SELECT [fld1],[fld2], fld[3], [fld4],[fld5] FROM icitem01 WHERE Item
= 'HF02-00856786'"

(ii) If the Item to select contains single-quotes, you need to double these
up to be valid SQL.
So

Item = 'O'Malley'

should be

Item = 'O''Malley'

Hope this helps

Stephen Howe



.



Relevant Pages

  • Re: recordset.save takes too long!
    ... the Save Method "saves the Recordset in a ... the configuration I developed under fails to perform well at the client site ... The CursorType does affect performance. ... Using adOpenKeyset or adOpenStatic would be better ...
    (microsoft.public.vb.general.discussion)
  • Re: CursorType, LockType von ADO-Recordsets
    ... Use the CursorType property to specify the type of cursor that should be used when opening the Recordset object. ... If an unsupported value is set, then no error will result; the closest supported CursorType will be used instead. ...
    (microsoft.public.de.access.clientserver)
  • Re: Cursors - Server Side - Only Forward?
    ... >Hi Gerard, ... the .CursorType ... >have to create a recordset yourself and execute the SQL ... >> Gulf Management Systems ...
    (microsoft.public.sqlserver.programming)
  • Re: Timeouts (80040E31) on AddNew
    ... > combination of LockType, CursorType and CursorLocation (and believe me, I've ... to guarantee that an empty recordset will be returned. ... using AddNew isn't generally as quick and clean ... as using SQL INSERT, but it is fairly straightforward and avoids certain ...
    (microsoft.public.inetserver.asp.db)
  • Re: Recordset.open with existing Records in the DB
    ... I .close the objects wenn finishing der Program, ... The provider does not support the property. ... >> If i open my empty DB an read the Recordset, ... > You will never get this CursorType. ...
    (microsoft.public.data.ado)