locked
connect sybase to excel vba 2013 RRS feed

  • Question

  • Hello everybody,

    Since one week, i have been trying connect sybase to excel vba, i tryed with sql anywhere, devart odbc and always it send the same errors, sometimes it send error 3706 provider cannot be found and sometimes the error is error 3709 the connection cannot be used to perform this operation.

    Does anyone have any suggestion? i have been looking through entire internet without success finding something useful, all redirect me to the same web sites and the same dead end.

    This is my code:

    Sub dos()
    
    Dim conn As ADODB.Connection
    
    Dim rs As ADODB.Recordset
    
    Set conn = New ADODB.Connection
    
    Set rs = New ADODB.Recordset
    
    conn.ConnectionString = "Provider=Sybase.ASEOLEDBProvider.2;Driver={SQL Anywhere 17};Server=dggbi01-iq;Port=10000;Database=iqdm;Uid=000000;Pwd=123456;"
    
    rs.Open "select * from LGL_DM_MUDA_ALL_METRICS_SUM_F_V ", conn, adOpenStatic, adLockReadOnly, adCmdTable
    
    With ThisWorkbook.Worksheets("test")
    
    .Visible = True
    
    .Range("a1:b1").Value = Array("PROJ_NUM", "PROJ_EN_NAME")
    
    .Range("A2").CopyFromRecordset rs
    
    .Activate
    
    End With
    
    rs.Close: Set rs = Nothing
    
    conn.Close: Set conn = Nothing
    End Sub
    

    Please help.

    Regards.

    Wednesday, October 30, 2019 10:01 PM