|
以下是引用leonard123在2006-11-21 14:27:00的发言:
求救:
我使用下面这段代码想把一个表中的字段的空格去掉,为什么执行后没有反映,空格在新表里还有呀?
Dim STemp As String
Dim i As Integer
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
STemp = "Select * From 供应商到货1"
rs.Open STemp, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Dim STemp1 As String
Dim rs1 As ADODB.Recordset
Set rs1 = New ADODB.Recordset
STemp1 = "Select * From 供应商到货"
rs1.Open STemp1, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If rs.RecordCount < 1 Then
Else
rs.MoveFirst
For i = 1 To rs.RecordCount
rs1.AddNew
rs1("供应商编码") = rs(Trim("供应商编码"))
rs1("订单号") = rs(Trim("订单号"))
rs1("门店部门") = rs(Trim("门店部门"))
rs1("录入员") = Username
rs.MoveNext
Next i
End If
rs.Update
rs.Close
rs1.Update
rs1.Close
Set rs = Nothing
Set rs1 = Nothing
rs(Trim())
改为
Trim(rs())试试?
|
|