主题:关于插入空值问题
Public constr As String = "provider=microsoft.jet.oledb.4.0; data source=d:\gongzitiao\db1.mdb"
Public mycon As OleDbConnection = New OleDbConnection(constr)
dim aa as string
aa=""
Dim str1 As String = "insert into luruxinxi(bianhao)values(@ri)"
Dim com1 As OleDbCommand = New OleDbCommand(str1, mycon)
com1.Parameters.Add("@ri", OleDbType.VarChar).Value = aa
如果我让 aa=""
那么运行时就会提示错误信息。出错点就是aa=""如果我把aa付值就没问题了
可是我想让这条记录存入空值.数据库中已经设置此条记录可为空了,
我应该怎么办?
多谢了
Public mycon As OleDbConnection = New OleDbConnection(constr)
dim aa as string
aa=""
Dim str1 As String = "insert into luruxinxi(bianhao)values(@ri)"
Dim com1 As OleDbCommand = New OleDbCommand(str1, mycon)
com1.Parameters.Add("@ri", OleDbType.VarChar).Value = aa
如果我让 aa=""
那么运行时就会提示错误信息。出错点就是aa=""如果我把aa付值就没问题了
可是我想让这条记录存入空值.数据库中已经设置此条记录可为空了,
我应该怎么办?
多谢了