Adodc1.ConnectionString = strcon
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * From table1"
Adodc1.Refresh

解决方案 »

  1.   

    gstrConnect = "driver={SQL Server}" & _
                "; Server=" & gStrServer & _
                "; uid=" & gstrUsername & "; pwd=" & gstrPassword & _
                "; database=" & gstrDatabase
       crptDrilling.Connect = gstrConnect
       crptDrilling.ReportFileName = strReportFile
       crptDrilling.SelectionFormula = strQuery
       crptDrilling.Action = 1
      

  2.   

    gstrConnect = "driver={SQL Server}" & _"; Server=" & gStrServer & _
    "; uid=" & gstrUsername & "; pwd=" & gstrPassword & _ "; database=" & gstrDatabase
    crptDrilling.Connect = gstrConnect
    crptDrilling.ReportFileName = strReportFile
    crptDrilling.SelectionFormula = strQuery
    crptDrilling.Action = 1