9
9898
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
dim conn2 As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDBatabase Password=jfwajney;Data Source=" &
Server.MapPath("/benhu/xajh.asp"))
conn2.open
Dim sql1 As String = "SELECT id FROM 用户 WHERE 姓名='" + name2 + "'"
Dim comm1 As OleDb.OleDbCommand = New OleDb.OleDbCommand(sql1, conn2)
Dim myread1 As OleDb.OleDbDataReader
myread1 = comm1.ExecuteReader
if not myreader1.read() then
myread1.close
comm1.commandtext='insert to 用户(姓名) values ('"+name2+')"
comm1.ExecuteNonQuery()
comm1.commandtext="SELECT id FROM 用户 WHERE 姓名='" + name2 + "'"
myread1= comm1.ExecuteReader
name=myread1("姓名")
end if
插入记录正确,但是随后的查询老实出错:提示无此记录
求各位帮帮忙
dim conn2 As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDBatabase Password=jfwajney;Data Source=" &
Server.MapPath("/benhu/xajh.asp"))
conn2.open
Dim sql1 As String = "SELECT id FROM 用户 WHERE 姓名='" + name2 + "'"
Dim comm1 As OleDb.OleDbCommand = New OleDb.OleDbCommand(sql1, conn2)
Dim myread1 As OleDb.OleDbDataReader
myread1 = comm1.ExecuteReader
if not myreader1.read() then
myread1.close
comm1.commandtext='insert to 用户(姓名) values ('"+name2+')"
comm1.ExecuteNonQuery()
comm1.commandtext="SELECT id FROM 用户 WHERE 姓名='" + name2 + "'"
myread1= comm1.ExecuteReader
name=myread1("姓名")
end if
插入记录正确,但是随后的查询老实出错:提示无此记录
求各位帮帮忙