Private Sub Command5_Click()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sql As String
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
Dim s As Integer
Dim xb As String
conn.ConnectionString = "Driver={sql server};server=19850620-SZD6CK;uid=sa;pwd=19850620;database=wubo"
conn.ConnectionTimeout = 30
conn.Open ConnectionString
s = Combo1.ListIndex
If s = 0 Then
xb = "男 "
Else
xb = "女 "
End If
sql = "insert into 学生情况表 values('" & Trim(Text1.Text) & " ','" & Trim(Text2.Text) & " ','" & xb & " ','" & Trim(Text3.Text) & " ','" & Trim(Text4.Text) & " ','" & Trim(Text5.Text) & " ','" & Trim(Text6.Text) & " ','" & Trim(Text7.Text) & " ','" & Trim(Text8.Text) & " ',)"
conn.Execute (sql)
End Sub
当我想给我数据库添加一些数据时候。出现下面的错误啊!黄色光标指向 conn.Execute(sql)这一行。提示出现
[Microsoft][odbc SQL Server Driver] [SQL Server] 第1行: ‘)’附近有语法错误。
那位大虾给小第指点一下迷津啊!!