Results 1 to 2 of 2

Thread: Datagrid and ADO

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Murcia
    Posts
    13

    Post

    I want to fill a datagrid using a ADO Recordset I have opened previosly, but it doesn't work. That's my code:
    ------------------------
    Option Explicit
    Public cnnoddo2 As ADODB.Connection
    Public rstactivos As ADODB.Recordset

    Private Sub Cmdrellenar_Click()
    Dim Sql_activo As String
    Set rstactivos = New ADODB.Recordset
    Sql_activo = "SELECT activo FROM activo_subyacente"
    rstactivos.Open Sql_activo, cnnoddo2, adOpenDynamic, adLockOptimistic
    Set DataGrid1.DataSource = rstactivos
    End Sub

    Private Sub Form_Load()
    Dim strconexion As String
    Set cnnoddo2 = New ADODB.Connection
    strconexion = "ODBC;DATABASE=ODDO;DSN=odbcoddo2;UID=sa" 'cadena de conexión
    cnnoddo2.Open strconexion
    End Sub
    ----------------------
    I have a data type error. (Type mismatch).

    Can anybody help me?. Any advice will be greatly apreciatted.
    Nauj

  2. #2
    Lively Member Maartin's Avatar
    Join Date
    Jan 2000
    Location
    Benoni, Gauteng, South-Africa
    Posts
    99

    Post

    The only way that i found so far that worked for me it to do a manual load.

    Using a loop.

    Wait some more and somebody might have another suggestion that is easier to use.

    ------------------
    Have Fun.
    Maartin.
    [email protected]
    -----------------------


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width