ADODC Control and moving through a record set

ADODC Control and moving through a record set

Post by jad » Sat, 15 Apr 2000 04:00:00



Folks,
   Ok I have a Form using an ADO Data Control.  At form activate time I set
the ConnectionString and
the recordsource.  According to the record count I get 3 records.  The First
records display in the fields they're bound to.  However, when I use the
record movement buttons on the ADODC nothing happens.  I must be screwing up
something simple but I can't figure out what.
Any Ideas?

Thanks In Advance,.

--
    {John}

    <pithy quote Goes here>
    ICBM Address: 32.46N 84.98W

 
 
 

ADODC Control and moving through a record set

Post by dcwar » Sun, 16 Apr 2000 04:00:00




> Folks,
>    Ok I have a Form using an ADO Data Control.  At form activate time
I set
> the ConnectionString and
> the recordsource.  According to the record count I get 3 records.
The First
> records display in the fields they're bound to.  However, when I use
the
> record movement buttons on the ADODC nothing happens.  I must be
screwing up
> something simple but I can't figure out what.
> Any Ideas?

> Thanks In Advance,.

> --
>     {John}

>     <pithy quote Goes here>
>     ICBM Address: 32.46N 84.98W

John
If you are using the Adodc1 control the connection string &
recordsource properties are inherent within the control and should not
be set in the form activiate event. Right click the Adodc1 control,
bring up the properties dialog box and set the connection properties
there. Remove the settings from the form activate event.
Alternatively (and some might suggest a better alternative) is to do
away with the Adodc1 control and create the db connection with pure ADO
code, which would normally be placed in the Form_Load event, or
composed as a sub procedure and called from the form load event. If you
want further info post a follow up reply.
Cheers, Dave
--
dcward

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

 
 
 

ADODC Control and moving through a record set

Post by ken ho » Mon, 17 Apr 2000 04:00:00


True that command are inherent, So you need the Adodc on the form and
set "recordset" [command type] to 1. In "General" select and leave [use
connection string] blank the add the following code to the form:

Set Connection1 = OpenDatabase(App.Path + "\" + "mydata.mdb")
Set Recordset1 = Connection1.OpenRecordset("Name_Of_Table", dbOpenTable)

Adodc1.ConnectionString = _
        "Provider=Microsoft.Jet.OLEDB.3.51;" & _
       "Data Source=" & app.file & "\mydata.mbd" & ";" & _
        "Persist Security Info=False"
Adodc1.RecordSource = "Select * FROM Name_Of_Table
Adodc1.Refresh

If Not Recordset1.EOF Then
     Recordset1.MoveLast
End If

Ken Howell
L-3 Communication


> John
> If you are using the Adodc1 control the connection string &
> recordsource properties are inherent within the control and should not
> be set in the form activiate event. Right click the Adodc1 control,
> bring up the properties dialog box and set the connection properties
> there. Remove the settings from the form activate event.
> Alternatively (and some might suggest a better alternative) is to do
> away with the Adodc1 control and create the db connection with pure ADO
> code, which would normally be placed in the Form_Load event, or
> composed as a sub procedure and called from the form load event. If you
> want further info post a follow up reply.
> Cheers, Dave
> --
> dcward

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

--
Posted via CNET Help.com
http://www.help.com/
 
 
 

ADODC Control and moving through a record set

Post by ken ho » Mon, 17 Apr 2000 04:00:00


It maybe your connection string or a setting is acting like a forward only
connection, or try setting the active record to the end of file, or
sometimes just deleting the a corrupted Adodc from the form and replacing
it will fix it, or try what I us:
     Adodc1.ConnectionString = _
        "Provider=Microsoft.Jet.OLEDB.3.51;" & _
       "Data Source=" & app.file & "\mydata.mbd" & ";" & _
        "Persist Security Info=False"

  ;but I am not sure what provider your using.  If all fails then it's
something in the database causing it display only one record but thats not
likly try connecting to a database you know works. Tweak till you
eliminate the overlooked.

ken howell
L-3 Communications


> Folks,
>    Ok I have a Form using an ADO Data Control.  At form activate time I
set
> the ConnectionString and
> the recordsource.  According to the record count I get 3 records.  The
First
> records display in the fields they're bound to.  However, when I use the
> record movement buttons on the ADODC nothing happens.  I must be
screwing up
> something simple but I can't figure out what.
> Any Ideas?

> Thanks In Advance,.

> --
>     {John}

>     <pithy quote Goes here>
>     ICBM Address: 32.46N 84.98W

--
Posted via CNET Help.com
http://www.help.com/
 
 
 

ADODC Control and moving through a record set

Post by jad » Thu, 20 Apr 2000 04:00:00


Hmm,  I've decided to abandon the ADODC control and use pure code.  Its a
small and straightforward change.
Note: the change to the Email address I'm now average 1 piece of SPAM a day.

--
    {John}
    JohnAD"AT"Knology.net
    <pithy quote Goes here>
    ICBM Address: 32.46N 84.98W

 
 
 

1. ADODB::Recordset::Move() erroneously setting EOF when moving to last record

I've found an odd problem.  I'm using the following:

Jet OLEDB 4.0
MDAC 2.6 SP1

I have an Access 2000 DB with a table containing 1,000 rows.  When I
open a recordset against that table, using a server-side cursor, and
call Move(999) EOF is erroneously set.  If I use a client-side cursor
it works correctly.  In addition, the problem only occurs when there
are at least 1,000 rows.  Here's some sample code:

    adoConn.Open "Provider=Microsoft.JET.OLEDB.4.0;Data source = " & _
        m_kstrDB
    Set adoRecSet.ActiveConnection = adoConn
    adoRecSet.CursorLocation = adUseServer
    adoRecSet.Open "Data", , adOpenForwardOnly, adLockOptimistic, _
        adCmdTable
    adoRecSet.Move 999

The call to Move() above should set the record pointer to record
1,000.  Instead, EOF gets set.  If I change the cursor location to
adUseClient, it works.

Note that changing the cursor type makes no difference.  Only the
location seems to have an effect.

Has anyone else seen this?

--
Charles Calvert             |  Software Design/Development
Celtic Wolf, Inc.           |  Project Management
http://www.celticwolf.com/  |  Technical Writing
(703) 580-0210              |  Research

2. stop screen updates?

3. Corrupt Indexing / Database ??

4. ADODC allows move even if record is invalid

5. Anyone doing Java s.p. in 8.1.5?

6. Need Help: Setting ADODC control ConnectString at Runtime

7. Oracle Stored procedures with ODBC

8. Setting ADODC control's datasource at runtime

9. How to put a Form parameter in Adodc Control Record Source property

10. Datagrid results to new record in adodc control recordsource

11. Delete a record usinf Adodc control

12. Delete a record using Adodc control