D
Dean Slindee
Is there a way to represent the null value as a string (destination: varchar
column) the way that the following string represents a null value for a
date?
Public Const cNullDate As Date = #12:00:00 AM#
Writing to an Access 2003, (conversion) table with VS2005 in VB.NET.
Within the table is a field named VSubType1 with a validation rule of: "In
('P','O') Or Is Null"
The declare/move/insert statements look like this (shortened example):
Dim intRecNbr As Integer = 0
Dim VSubType1 As Object (defined as Text 1 column in Access)
Dim V1_Mom_Id As Object (Long Integer)
Dim V1_Dad_Id As Object (Long Integer)
intRecNbr += 1
VSubType1 = System.DBNull.Value
V1_Mom_Id = 0
V1_Dad_Id = 0
'insert new row
sql = "INSERT INTO Convert_Case " & _
"(`RecNbr`, `VSubType1`, `V1_Mom_Id`, `V1_Dad_Id`) " & _
"VALUES (" & intRecNbr & ", '" & _
VSubType1 & "', " & _
V1_Mom_Id & ", " & _
V1_Dad_Id & ")"
'insert
Try
Dim lngRecordsAffected As Long = 0
cnnJet.Execute(sql, lngRecordsAffected, adCmdText +
adExecuteNoRecords)
Is there any way to code the "sql =" statement to pass a null value for
VSubType1? Like, maybe setting VSubType1 = Ctrl+0 (as in SQL Server)
instead of System.DBNull.Value? Or, perhaps System.DBNull.Value is not the
right value for null within Access db?
Thanks in advance,
Dean S
column) the way that the following string represents a null value for a
date?
Public Const cNullDate As Date = #12:00:00 AM#
Writing to an Access 2003, (conversion) table with VS2005 in VB.NET.
Within the table is a field named VSubType1 with a validation rule of: "In
('P','O') Or Is Null"
The declare/move/insert statements look like this (shortened example):
Dim intRecNbr As Integer = 0
Dim VSubType1 As Object (defined as Text 1 column in Access)
Dim V1_Mom_Id As Object (Long Integer)
Dim V1_Dad_Id As Object (Long Integer)
intRecNbr += 1
VSubType1 = System.DBNull.Value
V1_Mom_Id = 0
V1_Dad_Id = 0
'insert new row
sql = "INSERT INTO Convert_Case " & _
"(`RecNbr`, `VSubType1`, `V1_Mom_Id`, `V1_Dad_Id`) " & _
"VALUES (" & intRecNbr & ", '" & _
VSubType1 & "', " & _
V1_Mom_Id & ", " & _
V1_Dad_Id & ")"
'insert
Try
Dim lngRecordsAffected As Long = 0
cnnJet.Execute(sql, lngRecordsAffected, adCmdText +
adExecuteNoRecords)
Is there any way to code the "sql =" statement to pass a null value for
VSubType1? Like, maybe setting VSubType1 = Ctrl+0 (as in SQL Server)
instead of System.DBNull.Value? Or, perhaps System.DBNull.Value is not the
right value for null within Access db?
Thanks in advance,
Dean S