⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 db_setup.frm

📁 一个VB做的语音系统控件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form db_setup 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "数据主机设置"
   ClientHeight    =   1605
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4860
   Icon            =   "db_setup.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1605
   ScaleWidth      =   4860
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame1 
      Caption         =   "设置"
      Height          =   1575
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   4815
      Begin VB.CommandButton Command2 
         Caption         =   " 连 接 "
         Height          =   375
         Left            =   2880
         TabIndex        =   10
         Top             =   1080
         Width           =   1215
      End
      Begin VB.CommandButton Command1 
         Caption         =   " 关 闭 "
         Height          =   375
         Left            =   720
         TabIndex        =   9
         Top             =   1080
         Width           =   1215
      End
      Begin VB.TextBox db_passwd 
         Height          =   270
         IMEMode         =   3  'DISABLE
         Left            =   3240
         PasswordChar    =   "*"
         TabIndex        =   8
         Top             =   680
         Width           =   1335
      End
      Begin VB.TextBox db_name 
         Height          =   270
         Left            =   960
         TabIndex        =   7
         Top             =   680
         Width           =   1215
      End
      Begin VB.TextBox db_user 
         Height          =   270
         Left            =   3240
         TabIndex        =   6
         Top             =   320
         Width           =   1335
      End
      Begin VB.TextBox db_host 
         Height          =   270
         Left            =   960
         TabIndex        =   5
         Top             =   320
         Width           =   1215
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "密码:"
         Height          =   180
         Left            =   2400
         TabIndex        =   4
         Top             =   720
         Width           =   540
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "用户名:"
         Height          =   180
         Left            =   2400
         TabIndex        =   3
         Top             =   360
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "数据库:"
         Height          =   180
         Left            =   240
         TabIndex        =   2
         Top             =   720
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "主机名:"
         Height          =   180
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   720
      End
   End
End
Attribute VB_Name = "db_setup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
  Unload Me
End Sub

Private Sub Command2_Click()
  On Error Resume Next
  If db_host.Text = "" Then
     MsgBox "请输入服务器地址", vbOKOnly, "提示"
     Exit Sub
  End If
  If db_name.Text = "" Then
     MsgBox "请输入数据库名称", vbOKOnly, "提示"
     Exit Sub
  End If
  If db_user.Text = "" Then
     MsgBox "请输入用户名", vbOKOnly, "提示"
     Exit Sub
  End If
  Set conn = CreateObject("adodb.connection")
  conn.open "driver={sql server};server=" + db_host.Text + ";database=" + db_name.Text + ";uid=" + db_user.Text + ";pwd=" + db_passwd.Text
  If Err.Number <> 0 Then
     LOG.db_log.Text = ("数据库服务器连接失败(" + CStr(Now) + ")") + vbCrLf + LOG.db_log.Text
  Else
     connstring = "driver={sql server};server=" + db_host.Text + ";database=" + db_name.Text + ";uid=" + db_user.Text + ";pwd=" + db_passwd.Text
      LOG.db_log.Text = ("数据库服务器连接成功(" + CStr(Now) + ")") + vbCrLf + LOG.db_log.Text
      db_flag = True
      Unload Me
   End If
End Sub



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -