Consulting

Results 1 to 2 of 2

Thread: i have a problem about fields of executed query in vba

  1. #1

    i have a problem about fields of executed query in vba

    hi all;

    my code is the following:

    ---

    Private Sub CommandButton1_Click()

    Dim MyConnObj As New ADODB.Connection
    Dim myRecSet As New ADODB.Recordset
    Dim vkgs_list As New Collection
    Dim getiri_list As New Collection
    Dim tarih_list As New Connection

    MyConnObj.Open "Provider = sqloledb;" & "Data Source=192.168.0.99;" & "Initial Catalog=BDDK_SERVER;" & "User ID=RISKUSER;" & "Password=RISKUSER;"
    sqlStr = "select TARIH_DT, VKGS, GETIRI from VERIMEGRISI where VERIMEGRISI = 'USD.GOV' AND TARIH_DT > 20080501 ORDER BY TARIH_DT DESC, VKGS ASC"

    myRecSet.Open sqlStr, MyConnObj, adOpenKeyset

    For i = 1 To myRecSet.RecordCount
    '??
    '??
    '??

    Next
    MyConnObj.Close
    End Sub

    ---

    i have two problems:

    1) when i execute this query in sql 2005; i get more than 10.000 results. However i get only 1087 results in vba excel. why would it be so?

    2) i have three collections defined in the code. and want to fill them with the corresponding fields in the query.. that's; tarih_list as field(1); vkgs_list as field(2); getiri_list as field(3).. how can i do that?

    thanks in advance..

  2. #2
    is there any suggestion? i am really stuck with that

Posting Permissions

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