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

📄 updateform.frm

📁 用VB6如何来连接最新的SQL2005数据库,在本例中有详细的代码参考!分享是一种快乐
💻 FRM
字号:
VERSION 5.00
Begin VB.Form UpdateForm 
   Caption         =   "修改数据"
   ClientHeight    =   4155
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7125
   LinkTopic       =   "Form1"
   ScaleHeight     =   4155
   ScaleWidth      =   7125
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text2 
      Height          =   615
      Left            =   1440
      TabIndex        =   2
      Text            =   "Text2"
      Top             =   1200
      Width           =   3375
   End
   Begin VB.CommandButton Command1 
      Caption         =   "保存修改"
      Height          =   615
      Left            =   120
      TabIndex        =   0
      Top             =   2160
      Width           =   1215
   End
   Begin VB.Label Label3 
      Caption         =   "Label3"
      Height          =   375
      Left            =   1440
      TabIndex        =   4
      Top             =   480
      Width           =   1815
   End
   Begin VB.Label Label2 
      Caption         =   "学号:"
      Height          =   375
      Left            =   240
      TabIndex        =   3
      Top             =   480
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "学历:"
      Height          =   375
      Left            =   240
      TabIndex        =   1
      Top             =   1440
      Width           =   1215
   End
End
Attribute VB_Name = "UpdateForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
   '连接数据库 并且创建连接对象 Connection
   Dim conn
   Set conn = New adodb.Connection
   conn.Open "dsn=myDB", "sa", "sa456"
    
   
   Set rs = New Recordset
   
   sql = "update  学历  set xueli='" & Me.Text2.Text & "' where id=" & Me.Label3.Caption
   
   
   Set rs = conn.Execute(sql)
   
   MsgBox "恭喜恭喜,数据修改成功!"
   
   
   Unload UpdateForm

End Sub

⌨️ 快捷键说明

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