经典论坛's Archiver

bluefox204 发表于 2008-7-3 12:59

急。帮下忙

Dim conn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("../registrtion/database/regda.mdb"))
            Dim str As String
            str = "insert into test(text) values('" & TextBox1.Text & "')"
            Dim cmd As New OleDbCommand(str, conn)
            conn.Open()
            cmd.ExecuteNonQuery()
            conn.Close()
            Label1.Text = "您已经成功注册,谢谢您的支持!"

哪里错了,老是写不进数据库的..提示是insert inter语句错误!

honghu3000 发表于 2008-7-3 13:02

str = "insert into test (text) values('" + TextBox1.Text + "')"

[[i] 本帖最后由 honghu3000 于 2008-7-3 13:05 编辑 [/i]]

asq985 发表于 2008-7-3 13:04

test(text)是什么意思?

str="insert into ([列名],[列名]) Values ()"
把&改为+
这样试试

页: [1]



Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.