to_date error in vb

amitatwork
amitatwork used Ask the Experts™
on
i have the foll code in VB

dbaddress.Execute ("insert into officer values ( " & ssntxt.Text & ",'" & lnmtxt.Text & "','" & fnmtxt.Text & "','" & mnmtxt.Text & "','" & rank & "','" & sex & "','" & addtxt.Text & "', to_date( " & dojmmtxt.Text & ",'mm/dd/yyyy')," & stnidcmb.Text & " )")

i have used MS ACCESS and ADODB for connection
everything being correct why does vb give the foll error

Run-time error '-2147217900 (80040e14)':
[Microsoft][ODBC Microsoft Sccess Driver] undefined function 'to_date' in expression
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
TO_DATE is the Oracle function to convert a string to a date, this is not supported by Jet or MS SQL Server. You can use the Format() in VBA to format a date to the format required.

Cheers, Andrew

dbaddress.Execute ("insert into officer values ( " & ssntxt.Text & ",'" & lnmtxt.Text & "','" & fnmtxt.Text & "','" & mnmtxt.Text & "','" & rank & "','" & sex & "','" & addtxt.Text & "', #" & Format(CDate(dojmmtxt.Text), "mm/dd/yyyy") & "#,'" & stnidcmb.Text & "')")

Commented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - Answered by: TextReport  
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial