- 积分
- 1719
- 明经币
- 个
- 注册时间
- 2002-11-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 作者 于 2002-12-14 16:56:06 编辑
Private Sub ComboBox1_Click()
Dim cn As Connection
Set cn = New Connection
cn.Open "ROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=d:\cf.mdb;"
Dim cmd As New ADODB.Command
Set cmd.ActiveConnection = cn
cmd.CommandText = "select b,h,name from cf1 where name='" & ComboBox1.Text & "'"
Dim rst As New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.Open cmd, , adOpenStatic, adLockBatchOptimistic
Do While Not rst.EOF
UserForm1.TextBox1.Text = rst("h")
UserForm1.TextBox2.Text = rst("b")
rst.MoveNext
Loop
rst.Clone
End Sub
Private Sub CommandButton1_Click()
UserForm1.Hide
Dim pt As Variant
pt = ThisDrawing.Utility.GetPoint(, "拾取插入点:")
h = Val(UserForm1.TextBox1.Text)
b = Val(UserForm1.TextBox2.Text)
Dim ax1(0 To 2) As Double
Dim ax2(0 To 2) As Double
Dim ax3(0 To 2) As Double
Dim ax4(0 To 2) As Double
ax1(0) = pt(0)
ax1(1) = pt(1)
ax1(2) = pt(2)
ax2(0) = pt(0) + b
ax2(1) = pt(1)
ax2(2) = pt(2)
ax3(0) = pt(0)
ax3(1) = pt(1) + h
ax3(2) = pt(2)
ax4(0) = pt(0) + b
ax4(1) = pt(1) + h
ax4(2) = pt(2)
Dim linea, lineb, linec, lined As AcadLine
Set linea = ThisDrawing.ModelSpace.AddLine(ax1, ax2)
Set lineb = ThisDrawing.ModelSpace.AddLine(ax2, ax3)
Set linec = ThisDrawing.ModelSpace.AddLine(ax3, ax4)
Set lined = ThisDrawing.ModelSpace.AddLine(ax4, ax1)
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "10*20"
ComboBox1.AddItem "15*30"
ComboBox1.AddItem "20*40"
End Sub
执行以后出现这句提示:实时错误‘-2147217904(80040阿0)’:至少一个参数没有被指定值。
因有窗口,再还有一个ACCESS数据库,将之压缩上传 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|