怎么用select语句将数据库的字段赋给字符串变量? 5
当rId的字段为b时,要把对应的rcName字段内容赋给字符串bb,下面的代码要怎么改啊?DimstrConnAsString="Provider=Microsoft.J...
当rId的字段为b时,要把对应的rcName字段内容赋给字符串bb,下面的代码要怎么改啊?
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" & Application.StartupPath & "\dbRNA.mdb"
Dim Conn As OleDbConnection = New OleDbConnection(strConn)
Conn.Open()
Dim Cmd As OleDbCommand = New OleDbCommand()
Cmd.Connection = Conn
Dim sqlbase,bb As String
sqlbase = "select @bb=rcName from tRNA where rId='" & b & "'"
Cmd.CommandText = sqlbase 展开
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" & Application.StartupPath & "\dbRNA.mdb"
Dim Conn As OleDbConnection = New OleDbConnection(strConn)
Conn.Open()
Dim Cmd As OleDbCommand = New OleDbCommand()
Cmd.Connection = Conn
Dim sqlbase,bb As String
sqlbase = "select @bb=rcName from tRNA where rId='" & b & "'"
Cmd.CommandText = sqlbase 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询