Imports System.Data
Imports System.Data.OleDb

Dim tk_provider = "Provider=Microsoft.ACE.OLEDB.12.0"
'資料庫所在的路徑
Dim tk_database = "Data Source=" & Server.MapPath("ShopDB.accdb")
Dim tk_conn As New OleDbConnection(tk_provider & ";" & tk_database)
Dim tk_sql As String
tk_conn.Open()
tk_sql = "Insert Into 會員資料表 (帳號,密碼) Values ('" & TextBox1.Text & "','" & TextBox2.Text & "')"
Dim tk_cmd As New OleDbCommand(tk_sql, tk_conn)
tk_cmd.ExecuteNonQuery()
If Err.Number = 0 Then
       Label1.Text = "新增成功！"
	tk_conn.Close()
       Response.Redirect("P08View.aspx")
Else
       Label1.Text = Err.Description
 End If
 tk_conn.Close()