Thread: Date and oledb
View Single Post
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 114
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: Date and oledb

 
0
  #2
Oct 4th, 2008
What error message do you get?

Does this work in your code:
  1. Dim oConn As OleDbConnection
  2. Dim oCmd As OleDbCommand
  3. Dim strSQL As String
  4. Dim myDate As Date
  5.  
  6. myDate = CDate("4.10.2008") ' Use your locale date format, like "10/4/2008"
  7. strSQL = "INSERT INTO <mytable> (<my date field>) VALUES ('" & myDate & "')"
  8. oConn = New OleDbConnection("<your connectionstring")
  9. oConn.Open()
  10. oCmd = New OleDbCommand(strSQL, oConn)
  11. oCmd.ExecuteNonQuery()
Reply With Quote