<script language="VB" runat="server">
Sub Enter_Click(sender As Object, e As EventArgs)
Dim Exc As Exception '定义错误变量,用来捕获错误信息
Try
Dim filename,filepath As String
filename= Path.GetFileName(uploadfile.PostedFile.FileName) '获取上传文件名称
'filepath是服务器端保存上传文件的完整路径
filepath=Server.Mappath("upload") & "\" & filename
dim conn as new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=E:\mdb\date.mdb")
dim cmd as new OLEDBCommand("Insert Into tb_jianli(filename) values(#" &filepath& "#)",conn)
conn.open
cmd.ExecuteNonQuery()
conn.close()
uploadfile.PostedFile.SaveAs(filepath) '保存上传文件到upload文件夹中
Response.Redirect("index.aspx")
Catch Exc
message.Text = "保存文件时出错<br>" & Exc.ToString()
End Try
End Sub
</script>
编译器错误信息: BC32017: 应为逗号、“)”或有效的表达式继续符。
行14 错误