Dim cnADS As ADODB.Connection Dim rsTest As ADODB.Recordset ' Transaction flag Dim bTransaction As Boolean ' Timer variables Dim StartTime As Long Dim EndTime As Long ' Data vars Dim sAliasType As String Dim bDictionary As Boolean cnADS.ConnectionString = "Provider=Advantage OLE DB Provider" & _ ";Data Source=" & sDataSource & _ ";User ID=" & sUserID & _ ";Password=" & sPassword cnADS.Open Private Sub cmdExecute_Click() On Error GoTo ExecuteErr ' Clear the error message txtError.Text = "" Me.MousePointer = vbHourglass ' Make sure connection is active If cnADS.State = adStateClosed Then cmdConnect_Click ' Close the recordset before opening again If rsTest.State = adStateOpen Then rsTest.Close LoadSettings ' Start the timer StartTime = Timer ' Open the recordset rsTest.Open txtSQL.Text, cnADS, adOpenDynamic, adLockPessimistic, adCmdText Set dgcResult.DataSource = rsTest Me.MousePointer = vbDefault ' Finish time EndTime = Timer ' Display the time sbQuery.Panels(1).Text = CalcTime(EndTime - StartTime) sbQuery.Panels(2).Text = "Record Count: " & rsTest.RecordCount txtError.ForeColor = &HFF0000 txtError.Text = "SUCCESS!" Exit Sub ExecuteErr: Me.MousePointer = vbDefault txtError.ForeColor = &HFF& txtError.Text = Err.Description End Sub>Hi Simon,
>>Local loC,loD,lnSec1,lnSec2,lnSec3 >>lnSec1=Seconds() >>loC=CreateObject("ADODB.Connection") >>loC.ConnectionString="Provider=Advantage OLE DB Provider; Data Source=\\server1\apps\ads\FOPro.add; User ID=adssys; Password=teeka; Compression=ALWAYS; Server Type=6;Table Type=6" >>loC.CursorLocation=3 >>loC.Open >>loD=CreateObject("ADODB.RecordSet") >>loD.ActiveConnection=loC >>loD.Open("Select * From UPDatDic") >>Use dbf\updatdic >>Copy Structure to tmp\updatdic >>Use tmp\UPDatDic >>With loD >> lnSec3=Second() >> FOR ln=1 To .RecordCount >> Insert into UPDatDic (allownull,atype,autoinc,backcolor,boundcol,cdxfilter,cdxkey,cdxtype,; >> cdxunique,changed,cntrlclass,colwidths,conversion,dec,defaultcus,defaultVal,desc,; >> displayval,duplicate,editableby,encode,encrypt,filterable,; >> forecolor,format,id,inputmask,label,len,lookupord,method,name,pid,readonly,relatedto,; >> rowsource,rowstype,statusbar,table,type,usewith,visibleto,zip,_updated,_updatedby) ; >> Values (NVL(.Fields("AllowNull").Value,0),NVL(.Fields("AType").Value,""),NVL(.Fields("AutoInc").Value,0),; >> NVL(.Fields("BackColor").Value,-1),NVL(.Fields("BoundCol").Value,0),NVL(.Fields("CdxFilter").Value,""),; >> NVL(.Fields("CDXKey").Value,""),NVL(.Fields("CDXType").Value,""),NVL(.Fields("CDXUNique").Value,0),; >> NVL(.Fields("Changed").Value,0),NVL(.Fields("CntrlClass").Value,""),NVL(.Fields("ColWidths").Value,""),; >> NVL(.Fields("Conversion").Value,""),NVL(.Fields("Dec").Value,0),NVL(.Fields("DefaultCus").Value,0),; >> NVL(.Fields("DefaultVal").Value,""),NVL(.Fields("Desc").Value,""),NVL(.Fields("DisplayVal").Value,""),; >> NVL(.Fields("Duplicate").Value,0),NVL(.Fields("EditableBy").Value,-1),NVL(.Fields("Encode").Value,0),; >> NVL(.Fields("Encrypt").Value,0),NVL(.Fields("Filterable").Value,0),NVL(.Fields("ForeColor").Value,0),; >> NVL(.Fields("Format").Value,""),NVL(.Fields("ID").Value,""),NVL(.Fields("InputMask").Value,""),; >> NVL(.Fields("Label").Value,""),NVL(.Fields("Len").Value,0),NVL(.Fields("LookupOrd").Value,""),; >> NVL(.Fields("Method").Value,""),NVL(.Fields("Name").Value,""),NVL(.Fields("PID").Value,""),; >> NVL(.Fields("ReadOnly").Value,0),NVL(.Fields("RelatedTo").Value,""),NVL(.Fields("RowSource").Value,""),; >> NVL(.Fields("RowSType").Value,0),NVL(.Fields("StatusBar").Value,""),NVL(.Fields("Table").Value,""),; >> NVL(.Fields("Type").Value,""),NVL(.Fields("UseWith").Value,""),NVL(.Fields("VisibleTo").Value,-1),; >> NVL(.Fields("Zip").Value,0),NVL(.Fields("_Updated").Value,""),NVL(.Fields("_UpdatedBy").Value,"")) >> .MoveNext >> EndFor >>EndWith >>lnSec2=Seconds() >>? lnSec2-lnSec1 120sec >>? lnSec2-lnSec3 3.5sec >>>>