dim sqlsql="insert into table(cust_id,cust_name,cust_data) values(" sql=sql & "'"&text1.text&"'," sql=sql & "'"&text2.text&"'," sql=sql & "'"&text3.text&"')"con.execute(sql)
Dim DB As New Connection DB.ConnectionString="连接数据库的字符串" DB.Open '如果已连好的话可以不写 Dim C as New Command C.ActiveConnection=DB C.CommandType=adCmdText C.CommandType="insert into customer(cust_id,cust_name,cust_data) values('"& text1.text &"','"& text2.text & "','" & text3.text & "'" C.Execute
conn.execute " insert into customer(cust_id,cust_name,cust_data) values('"& text1.text &"','"& text2.text &"','"& text3.text &"')"
'如果cust_data为数值型:
conn.execute " insert into customer(cust_id,cust_name,cust_data) values('"& text1.text &"','"& text2.text &"',"& text3.text &")"
sql=sql & "'"&text1.text&"',"
sql=sql & "'"&text2.text&"',"
sql=sql & "'"&text3.text&"')"con.execute(sql)
DB.ConnectionString="连接数据库的字符串"
DB.Open '如果已连好的话可以不写
Dim C as New Command
C.ActiveConnection=DB
C.CommandType=adCmdText
C.CommandType="insert into customer(cust_id,cust_name,cust_data) values('"& text1.text &"','"& text2.text & "','" & text3.text & "'"
C.Execute