Re: Problem creating a populated ado recordset
- From: "Stephen Howe" <sjhoweATdialDOTpipexDOTcom>
- Date: Fri, 26 Aug 2005 03:15:13 +0100
> 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
.
- References:
- Problem creating a populated ado recordset
- From: franky
- Problem creating a populated ado recordset
- Prev by Date: RE: ADO update to VFP database
- Next by Date: Login failed for user
- Previous by thread: Problem creating a populated ado recordset
- Next by thread: Login failed for user
- Index(es):
Relevant Pages
|
|