📄 frmdbfxz.frm
字号:
VERSION 5.00
Begin VB.Form frmdbfxz
BackColor = &H00FF8080&
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmddbf
Caption = "退出"
Height = 375
Index = 3
Left = 2880
TabIndex = 5
Top = 2400
Width = 1455
End
Begin VB.CommandButton cmddbf
Caption = "恢复默认库"
Height = 375
Index = 2
Left = 2880
TabIndex = 4
Top = 1840
Width = 1455
End
Begin VB.CommandButton cmddbf
Caption = "设置为默认库"
Height = 375
Index = 1
Left = 2880
TabIndex = 3
Top = 1280
Width = 1455
End
Begin VB.CommandButton cmddbf
Caption = "设置为当前库"
Height = 375
Index = 0
Left = 2880
TabIndex = 2
Top = 720
Width = 1455
End
Begin VB.ListBox Listdbf
Height = 2010
Left = 360
TabIndex = 1
Top = 720
Width = 1695
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "请选择数据库:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 0
Top = 240
Width = 2055
End
End
Attribute VB_Name = "frmdbfxz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub cmddbf_Click(Index As Integer)
Dim i As Integer
Dim j As Integer
Dim bb As Boolean
i = InStr(nowconnectstring, "ysgl")
j = Len(nowconnectstring)
Select Case Index
Case 0
nowconnectstring = Left(nowconnectstring, i - 1) & Listdbf.Text & Right(nowconnectstring, j - i + 1 - 8)
Case 1
'nowconnectstring = Left(nowconnectstring, i - 1) & "ysgl" & Left(Date, 4) & Right(nowconnectstring, j - i + 1 - 8)
nowconnectstring = Left(nowconnectstring, i - 1) & Listdbf.Text & Right(nowconnectstring, j - i + 1 - 8)
bb = modiini(nowconnectstring, "数据库信息", "数据库", App.path + "\资金管理.ini")
bb = modiini("ysgl" & Left(Date, 4), "数据库信息", "database", App.path + "\资金管理.ini")
Case 2
nowconnectstring = connectstring
Case 3
Unload Me
End Select
End Sub
Private Sub Form_Load()
If conn.State <> 1 Then
conn.CursorLocation = adUseClient
conn.Open nowconnectstring
End If
conn.Execute ("use master")
Set rs = conn.Execute("select * from sysdatabases where left(name,4)='ysgl'")
Do While Not rs.EOF
Listdbf.AddItem rs.Fields("name")
rs.MoveNext
Loop
rs.Close
conn.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
If conn.State = 1 Then
conn.Close
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -