📄 begin.bas
字号:
Attribute VB_Name = "begin"
Public P_T As Long
Public P_l As Long
Public P_R As Long
Public P_B As Long
Public P_Bt As String
Public P_Bl As Double
Public P_page As Integer
Public P_N As String
Public Zt As String
Public User As String
Public JZYEAR As Integer
Public JZMONTH As Integer
Public sqlconn As New ADODB.Connection
Public Data As String '数据库名
Sub Main()
Dim myclass As New CreateDatabase
myclass.Create_SysDatabase
DlForm.Show
End Sub
Sub sqlconn_open()
Dim strConntion As String
On Error GoTo err:
strConntion = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=" & Data
If sqlconn.state = 0 Then
sqlconn.ConnectionString = strConntion
sqlconn.Open
End If
Exit Sub
err:
MsgBox "不能连接数据", vbInformation, "提示"
End
End Sub
Function AddDataComboBox(ByVal strSql As String, ByVal myComboBox As ComboBox)
Dim mycommand As New ADODB.Command
Dim myreder As New ADODB.Recordset
sqlconn_open
mycommand.ActiveConnection = sqlconn
mycommand.CommandType = adCmdText
mycommand.CommandText = strSql
Set myreder = mycommand.Execute
While Not myreder.EOF()
myComboBox.AddItem (myreder.Fields(0).Value)
myreder.MoveNext
Wend
sqlconn.Close
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -