Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Multiple row on query vba

I make a request to a database where it returns more than one row, but it only returns the first record it finds

Dim tField As ADODB.Field
        '
        ' Por si ya estaba abierta...
        cnn = Nothing
        rst = Nothing
        '
        ' Crear los objetos
        cnn = New ADODB.Connection
        rst = New ADODB.Recordset
        '
        ' abrir la base usando las credenciales de Windows
        cnn.Open("Data Source='db';User ID='sas';Password='1234';")
        rst.Open("Select IDSCRIPT,NOMBRE From [DBEVO].[dbo].[company]", cnn)
        Dim numbers As New ArrayList
        Dim grid = {{}}
        For Each tField In rst.Fields
            numbers.Add(tField.Value)
            Console.WriteLine(tField.Value)
// return only the first row
        Next
Console.Read()
        rst.Close()
        cnn.Close()

Comments