ksrun 2008-07-08 11:07:43
Dim op As Integer
Dim cu As String
Dim gs, gs1 As Integer
Dim st, st1, ay, ax As String
op = 0
st = UCase(Trim\$(Text1.Text))
st1 = UCase(Trim\$(Text2.Text))
gs = Len(st)
gs1 = Len(st1)
If gs > gs1 Then

For i = 1 To gs
ay = Mid\$(st, i, 1)
ax = Mid\$(st1, i, 1)
If ay <> ax Then
op = op + 1
cu = cu + ay
If Len(st) >= i Then
st = Left\$(st, i - 1) + Right\$(st, Len(st) - i)
i = i - 1
End If
Else
End If
Next i

If Option1.Value = True Then
txtsql = "select 批次大 from 出入库明细表 where 批次大='" & UCase(Text1.Text) & "'"
End If
If Option2.Value = True Then
txtsql = "select 批次大 from 鞋面大底出入库明细表 where 批次大='" & UCase(Text1.Text) & "'"
End If
Set myrecord = ExecuteSQL(txtsql, msgtext)
myrecord.MoveFirst
For io = 1 To myrecord.RecordCount
myrecord("批次大") = Trim\$(Text2.Text)
myrecord.Update
myrecord.MoveNext
Next io

For i = 1 To Len(cu)
sttu1 = Mid\$(cu, i, 1)
sttu = Mid\$(UCase(Trim\$(Text1.Text)), 1, j0) + sttu1
If Option1.Value = True Then
txtsql = "select 批次大,批次 from 出入库明细表 where 批次='" & sttu & "'"
End If
If Option2.Value = True Then
txtsql = "select 批次大,批次 from 鞋面大底出入库明细表 where 批次='" & sttu & "'"
End If
Set myrecord = ExecuteSQL(txtsql, msgtext)
If myrecord.RecordCount > 0 Then
myrecord.MoveFirst
For io = 1 To myrecord.RecordCount
myrecord("批次大") = Trim\$(sttu)
myrecord.Update
myrecord.MoveNext
Next io
End If
Next i
MsgBox "执行成功"
Else

myrecord.MoveFirst
For io = 1 To myrecord.RecordCount
myrecord("批次大") = Trim\$(Text2.Text)
myrecord.Update
myrecord.MoveNext
Next io
MsgBox "执行成功"
End If

...全文
81 6 打赏 收藏 转发到动态 举报

6 条回复

xiaojing7 2008-07-10
• 打赏
• 举报

vb不解！

• 打赏
• 举报

``````int op=0;
string cu="";
int gs, gs1;
string st="", st1="", ay="", ax="";
st = UCase(Text1.Text.Trim()) ;
st1 = UCase(Text2.Text.Trim());
gs = st.Length;
gs1 = st1.Length;
if (gs > gs1)
{
for (int i = 1; i < gs; i++)
{
ay = st.Substring(i, 1);
ax = st1.Substring(i, 1);
if (ay != ax)
{
op++;
cu += ay;
if (st.Length >= i)
{
st = st.Substring(0, i - 1) + st.Substring(st.Length - i, i);
i = i - 1;
}
else
{
//这里有个空操作
}
}
}
if (Option1.Value)
txtSql = "select 批次大  from 出入库明细表 where 批次大='" + UCase(Text1.Text) + "'";
if (Option2.Value)
txtSql = "select 批次大 from 鞋面大底出入库明细表 where 批次大='" + UCase(Text1.Text) + "'";
for (int io = 1; io < myrecord.RecordCount; io++)
{
myrecord("批次大") = Text2.Text.Trim();
myrecord.Update();
}
for (int i = 1; i < cu.Length; i++)
{
sttu1 = cu.Substring(i, 1);
sttu = UCase(Text1.Text.Trim()).Substring(i, 1) + sttu1;
if (Option1.Value)
{
txtsql = "select 批次大,批次  from 出入库明细表 where 批次='" + sttu + "'";
}
if (Option2.Value)
{
txtsql = "select 批次大,批次 from 鞋面大底出入库明细表 where 批次='" + sttu + "'";
}
if (myrecord.RecordCount > 0)
{
for (int io = 1; io < myrecord.RecordCount; io++)
{
myrecord("批次大") = Text2.Text.Trim();
myrecord.Update();
}
}
}
MessageBox.Show("执行成功");
}
else
{
for (int io = 1; io < myrecord.RecordCount; io++)
{
myrecord("批次大") = Text2.Text.Trim();
myrecord.Update();
}
MessageBox.Show("执行成功");
}``````

songyingjian2008 2008-07-10
• 打赏
• 举报

VB不太懂
ksrun 2008-07-08
• 打赏
• 举报

• 打赏
• 举报

beancurd005 2008-07-08
• 打赏
• 举报

VB的问题怎么跑到C#专区了哦，不解。。。

110,617

• 近7日
• 近30日
• 至今