I need help,i have a problem,i cant seem to insert from my vb interface to my access database...for example the access field is a fate type......how am i supposed to do it?,like if i enter my date like 24/2/08,it ll go in database,i tried my oledb.varchar,oledb.dbdate also does not work....can some1 help me out with this...everytime i use it i get error in insert into statement

What error message do you get?

Does this work in your code:

Dim oConn As OleDbConnection
Dim oCmd As OleDbCommand
Dim strSQL As String
Dim myDate As Date

myDate = CDate("4.10.2008") ' Use your locale date format, like "10/4/2008"
strSQL = "INSERT INTO <mytable> (<my date field>) VALUES ('" & myDate & "')"
oConn = New OleDbConnection("<your connectionstring")
oConn.Open()
oCmd = New OleDbCommand(strSQL, oConn)
oCmd.ExecuteNonQuery()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.