recordset problem

blinx
10-17-2004, 09:32 PM
filename = Flistbox.List(i)

Set rslog = New ADODB.Recordset
strSQL2 = "select * from logfiles"
rslog.Open strSQL2, connectionString, adOpenDynamic, adLockOptimistic

rslog.AddNew
rslog!cabang = Left(filename, 3)
rslog!tanggal = Mid(filename, 6, 2)

If UCase(Mid(filename, 4, 2)) = "SO" Then
rslog!SO = "1"
End If


rslog!complete = Format$(Now, "mm-dd hh:mm:ss")
rslog.Update


Hey I'm using this code to update the rslog!SO files, but why this code doesn't work
Thx

mrkamran
10-18-2004, 12:20 AM
check your "If UCase(Mid(filename, 4, 2)) = "SO" Then" statement
becuse it statement will work only when your filename contain SO at location 4.

MKoslof
10-18-2004, 05:51 AM
Is the SO field the only one that is not updating properly? If none of the fields are updating, show us your connectionstring variable, how is this defined?

And for your recordset updating use the fields collection like so:



With rs
.AddNew
.Fields("cabang") = Left(fileName, 3)
.Fields("tanggal") = Mid(fileName,6,2)
'do your if to check the SO field, etc
.Update
End With

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum