📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
Caption = "Form3"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form3"
ScaleHeight = 11115
ScaleWidth = 15240
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Dim str As Variant
Dim cn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = "provider=msdasql.1;USER ID=sa;password=;initial catalog=bus;data source=data;"
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT * from table1 order by " & "str$(线路)"
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockReadOnly
rs.Open cmd
cmd.Execute
Set DataGrid1.DataSource = rs
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -