我有一段VB程序,可是看不懂,帮我解释一下,谢谢

来源:百度知道 编辑:UC知道 时间:2024/06/21 19:39:14
Private Sub Command1_Click()
Dim adoRS1 As New ADODB.Recordset
Dim strConn As String
Dim strSQL As String

Dim strDataFile As String
Dim strTableName As String
Dim strTemp As String

strDataFile = "KYGL.MDB"

strConn = "Data Source=" & strDataFile & ";Provider=Microsoft.Jet.OLEDB.4.0"

If Not UCase(考题.getSelectedTestAn) = UCase(Text2.Text) Then
strTestSc = 0
End If

'其它参数可以根据情况选用
If intRecon <= 0 Then
strSQL = "insert into answer (姓名,考次,编号,回答,得分) values ('" & Form2.Label1 & "', '" & 考题.rdnbTmp & "', '" & strTestNumber & "', '" & Text2.Text & "', '" & strTestSc & "') "
Else
strSQL = "update answer set 回答='" & Text2.Text & "', 得分=" & strTestSc

Private Sub Command1_Click()
‘定义数据集
Dim adoRS1 As New ADODB.Recordset
‘定义数据库连接
Dim strConn As String
‘定义SQL字符串
Dim strSQL As String

Dim strDataFile As String
Dim strTableName As String
Dim strTemp As String
‘数据库名
strDataFile = "KYGL.MDB"
‘定义数据库连接字符串
strConn = "Data Source=" & strDataFile & ";Provider=Microsoft.Jet.OLEDB.4.0"

If Not UCase(考题.getSelectedTestAn) = UCase(Text2.Text) Then
strTestSc = 0
End If

'其它参数可以根据情况选用
If intRecon <= 0 Then
‘插入数据
strSQL = "insert into answer (姓名,考次,编号,回答,得分) values ('" & Form2.Label1 & "', '" & 考题.rdnbTmp & "', '" & strTestNumber & "', '" & Text2.Text & "', '" & strTestSc & "') "
Else
‘更新更新
strSQL = "update answer