Dim s As Integer
s = Val(Text2.Text)
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd1 As New ADODB.Command
Dim dj As Integer
Dim sy As Long
Dim strcnn As String
Dim strsql As String
strsql = "select * from 商品表 where 编号='" & s & "'"
strcnn = "provider=microsoft.jet.oledb.4.0;data source=数据2.mdb;"
Set cn = New ADODB.Connection
cn.Open strcnn
Set rs = New ADODB.Recordset
Set cmd1 = New ADODB.Command
cmd1.ActiveConnection = cn
cmd1.CommandText = strsql
Set rs = cmd1.Execute
rs.MoveFirst
Do While Not rs.EOF()
Text3.Text = rs!零售单价
kc = (Text4.Text)
Loop
rs.Close
cn.Close
dj = Val(Text3.Text)
sy = dj * kc
Text6.Text = Val(Text5.Text) - Val(sy)
s = Val(Text2.Text)
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd1 As New ADODB.Command
Dim dj As Integer
Dim sy As Long
Dim strcnn As String
Dim strsql As String
strsql = "select * from 商品表 where 编号='" & s & "'"
strcnn = "provider=microsoft.jet.oledb.4.0;data source=数据2.mdb;"
Set cn = New ADODB.Connection
cn.Open strcnn
Set rs = New ADODB.Recordset
Set cmd1 = New ADODB.Command
cmd1.ActiveConnection = cn
cmd1.CommandText = strsql
Set rs = cmd1.Execute
rs.MoveFirst
Do While Not rs.EOF()
Text3.Text = rs!零售单价
kc = (Text4.Text)
Loop
rs.Close
cn.Close
dj = Val(Text3.Text)
sy = dj * kc
Text6.Text = Val(Text5.Text) - Val(sy)
s = Val(Text2.Text)
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd1 As New ADODB.Command
Dim dj As Integer
Dim sy As Long
Dim strcnn As String
Dim strsql As String
strsql = "select * from 商品表 where 编号='" & s & "'"
strcnn = "provider=microsoft.jet.oledb.4.0;data source=数据2.mdb;"
Set cn = New ADODB.Connection
cn.Open strcnn
Set rs = New ADODB.Recordset
Set cmd1 = New ADODB.Command
cmd1.ActiveConnection = cn
cmd1.CommandText = strsql
Set rs = cmd1.Execute
rs.MoveFirst
If rs.recordcout > 0 Then
Text3.Text = rs!零售单价
kc = (Text4.Text)
End If
rs.Close
cn.Close
dj = Val(Text3.Text)
sy = dj * kc
Text6.Text = Val(Text5.Text) - Val(sy)
Dim s As DoubleDim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd1 As New ADODB.CommandDim dj As Double
Dim sy As Double
Dim kc As DoubleDim strcnn As String
Dim strsql As Strings = Val(Text2.Text)
strsql = "select * from ÉÌÆ·±í where ±àºÅ='" & s & "'"
strcnn = "provider=microsoft.jet.oledb.4.0;data source=Êý¾Ý2.mdb;"
cn.ConnectionString = strcnn
cn.Openrs.Open strsql, cn, adOpenStatic, adLockOptimisticIf Not rs.EOF Then
rs.MoveFirst
Text3.Text = IIf(IsNull(rs!ÁãÊÛµ¥¼Û), 0, rs!ÁãÊÛµ¥¼Û)
kc = Val(Trim(Text4.Text))Else
Exit Sub
End If rs.Close
cn.Closedj = Val(Text3.Text)
sy = dj * kc
Text6.Text = Val(Text5.Text) - Val(sy)End Sub
s = Val(Text2.Text)
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim cmd1 As New ADODB.Command
Dim dj As Integer
Dim sy As Long
Dim strcnn As String
Dim strsql As String
strsql = "select * from 商品表 where 编号='" & s & "'"
strcnn = "provider=microsoft.jet.oledb.4.0;data source=数据2.mdb;"
Set cn = New ADODB.Connection
cn.Open strcnn
Set rs = cn.Execute(strsql)
If Not rs.EOF Then
rs.MoveFirst
Text3.Text = rs!零售单价
End If
rs.Close
cn.Close
kc = Text4.Text
dj = Val(Text3.Text)
sy = dj * kc
Text6.Text = Val(Text5.Text) - Val(sy)