-
I am using Access Database in my VB application.
Thare is one table which contains HireDate field which is of Date data type.This Field is optional.How can i insert a null date into it using SQL Insert Statement From VB. I am using DAO and Execute method.
-
You could either pass the Null keyword, or you could specify the fields you want to fill.
eg
with a table like this:
name:
tblContact
Fields:
ContId (Long)
ContName (Text)
ContBirthday (Date)
Insert into tblContact Values( 1, 'Frans', Null)
Or
Insert Into tblContact (ContId, ContName) Values( 1, 'Frans')
-
Hello gorthims,
In my database programs, this allways works!
Private Sub Form_Load()
Dim DbSetting As String
Dim DB As Database
Dim RS As Recordset
DbSetting = "f:\q.mdb"
Set DB = OpenDatabase(DbSetting)
Set RS = DB.OpenRecordset("select * from personal")
RS.MoveFirst
'HireDate is type Date
RS.Edit
RS("HireDate") = Null
RS.Update
End Sub
Nice regards,
Michelle.
-