打印

[.net] ASP.NET (VB)

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Label2.Visible = True
        If TextBox30.Text = "" Or TextBox31.Text = "" Then
            Label2.Text = "填写用户名和密码"
        Else
            Dim conn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("../intreg/mydata.mdb"))
            Dim cmd As New OleDbCommand("select * from users where username='" & TextBox30.Text & "'And pwd='" & TextBox31.Text & "'", conn)
            conn.Open()
            Dim dr As OleDbDataReader = cmd.ExecuteReader()
            If dr.Read() = True Then
                conn.Close()
                Panel1.Visible = True
                Panel2.Visible = False
            Else
                conn.Close()
                Label2.Text = "您必须输入有效的用户名和密码!"
            End If
        End If
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Label3.Visible = True
        If TextBox32.Text = "" Or TextBox33.Text = "" Or TextBox34.Text = "" Then
            Label3.Text = "请填写用户名和密码"
        ElseIf TextBox32.Text <> TextBox34.Text Then
            Label3.Text = "两次密码不同"
        Else
            Dim conn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("../intreg/mydata.mdb"))
            Dim cmd As New OleDbCommand("select * from users where username='" & TextBox33.Text & "'", conn)
            conn.Open()
            Dim dr As OleDbDataReader = cmd.ExecuteReader
            If dr.Read() Then
                Label3.Text = "您选择的用户名已经存在,请重新选择!"
                conn.Close()
            Else
                conn.Close()
                Dim conn1 As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("../intreg/mydata.mdb"))
                Dim str As String
                str = "insert into users(username,pwd) values('" & TextBox33.Text & "','" & TextBox32.Text & "')"
                Dim cmd1 As New OleDbCommand(str, conn1)
                conn1.Open()
                cmd1.ExecuteNonQuery()
                conn1.Close()
                Panel2.Visible = True
                Panel3.Visible = False
            End If
        End If
    End Sub



为什么我在本地调试的时候没问题,可是一上传到FTP后,写不进数据库了???
Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>


这是错误提示....
服务器没开写入权限
不是吧...我另一份传上去可以写入的.应该不是写入权限的问题

TOP

还在为头像烦恼?还在为不能关注好友动态烦忧?快来蓝色理想家园吧!
http://a236916.s88.gzonet.com就这网站,大哥,大姐们帮忙看下.为什么一写入数据就出错

TOP

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


把web.config里的customErrors模式设置为Off.再看看是提示什么错误
评词党,欢迎加入友链接 http://www.pingcd.com/

TOP