Static vs Dynamic Recordsets

Static vs Dynamic Recordsets

Post by Dave Gun » Wed, 26 Jan 2000 04:00:00



I am creating a recordset to an AS400 file via ODBC.  I want the
recordset to be Static so I am setting the CursorType property to
adOpenStatic just prior to the recordset Open statement.  The Open
statement is causing the recordset to be Dynamic.

Any ideas as to why this is happening?  And is there a way to prevent it?

Here is the code:

Dim sConnect    As String
Dim cnDownload  As ADODB.Connection
Dim SchedProdRS AS ADODB.Recordset

sConnect = "ODBC;Database=DOWNLOAD;UID=" & gsUserName & ";PWD=" & _
gsPassword & ";DSN=AS400;"

Set cnDownload = New ADODB.Connection
cnDownload.Open sConnect

Set SchedProdRS = New ADODB.Recordset

SchedProdRS.CursorType = adOpenStatic
SchedProdRS.LockType = adLockReadOnly
SchedProdRS.Open "select * from DOWNLOAD.TestFile" , cnDownload

Thanks
Dave

 
 
 

Static vs Dynamic Recordsets

Post by Rebecca Riorda » Thu, 27 Jan 2000 04:00:00


Are you sure your ODBC data source supports static recordsets?  Not all
do...

--
Rebecca Riordan
Author of Designing Relational Database Systems
http://www.cyriv.com/RDBBook.htm


Quote:> I am creating a recordset to an AS400 file via ODBC.  I want the
> recordset to be Static so I am setting the CursorType property to
> adOpenStatic just prior to the recordset Open statement.  The Open
> statement is causing the recordset to be Dynamic.

> Any ideas as to why this is happening?  And is there a way to prevent it?

> Here is the code:

> Dim sConnect    As String
> Dim cnDownload  As ADODB.Connection
> Dim SchedProdRS AS ADODB.Recordset

> sConnect = "ODBC;Database=DOWNLOAD;UID=" & gsUserName & ";PWD=" & _
> gsPassword & ";DSN=AS400;"

> Set cnDownload = New ADODB.Connection
> cnDownload.Open sConnect

> Set SchedProdRS = New ADODB.Recordset

> SchedProdRS.CursorType = adOpenStatic
> SchedProdRS.LockType = adLockReadOnly
> SchedProdRS.Open "select * from DOWNLOAD.TestFile" , cnDownload

> Thanks
> Dave


 
 
 

1. Dynamic vs. Static Hashed Files


[snip]

I LOVE dynamic files!  If for no other reason than they eliminate the need
for me to constantly remind clients that file maintenance is REALLY
somthing they need to do.  One of the best uses I have found for dynamic
files is with LARGE (say.. modulo > 100,000) files which would take days
to resize.  

I agree with your findings on the parameters, unless you have a file with
greatly varying record sizes, or some other strangeness, the defaults
generaly work well. These days, I always use dynamic files for all new
development (mostly under Universe) and havent had a problem with them
on any release >= 7.3

*** A PLEA TO VMARK***  Prime's RECLAIM was a wonderfull tool...hint,hint!

regards,
        Jeff

===================================================
Jeff Schasny     | DoD# 1735  '87 Yamaha FZ700    

===================================================

2. Help with Socket calls in Datablade IDS/UDO 9.14X

3. Dynamic vs. Static

4. password

5. performance of dynamic vs. static SQL

6. General network error. Check your network documentation.

7. Static vs. Dynamic ESQL

8. $100,000.00 REWARD 4 AL Hill ex-Dayton Power & Light President

9. Dynamic Files vs Static Hashed - Performance Issues

10. Dynamic SQL Vs Static SQL using Pro*C..

11. STATIC vs. DYNAMIC SQL and ODBC

12. Dynamic filter vs static filter...

13. Dynamic vs Static Stored Procedures