| |
djfitzie
Posts: 7
Score: 0
Joined: 10/4/2006
Status: offline
|
Hi, I am new to the forum and have only been working with vbscript for a short period. I am trying to change data in one column of an access table depending on it meeting the criteria from another column. The code i am using is listed below. I am having a problem in that it updates the first entry and then the script runs using 100% cpu until I cancel it. On Error Resume Next Const adOpenStatic = 3 Const adLockOptimistic = 3 Set objConnection = CreateObject("ADODB.Connection") Set objRecordSet = CreateObject("ADODB.Recordset") objConnection.Open _ "Provider = Microsoft.Jet.OLEDB.4.0; " & _ "Data Source = C:\Program Files\Free Scan\DATA\InctDat.mdb" objRecordSet.Open "SELECT * FROM tblConsolidatedSales" , _ objConnection, adOpenStatic, adLockOptimistic Set dtmStartDate = CreateObject("WbemScripting.SWbemDateTime") strCriteria = "TRDate <= dtmStartDate" Do Until objRecordSet.EOF objRecordSet.Find strCriteria objRecordset.Fields.Item("ReceiptDate") = "16/08/2006 4:04:18 AM" objRecordset.Update Loop objRecordSet.Close objConnection.Close Any assistance with this would be greatly appreciated. Regards David
|
|