如何将日期时间保存到访问数据库中 [英] How to save datetime into access database

查看:116
本文介绍了如何将日期时间保存到访问数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将日期时间保存为格式为dd / MM / yyyy hh:mm:ss的访问权限?

我尝试使用此格式但是错过了日期和月份..

在我的访问数据库中使用格式dd / mm / yyyy hh:nn:ss

所以我使用这样的格式并且没有错过..



我尝试过:



 dim actdate = DateTime.Now .ToString(MM / dd / yyyy hh:mm:ss)



并使用保存方法:

 cmd.parameters.Add(New OleDbParameter(letdate,CType(actdate,Date)))

解决方案

像这样:

  Dim  actDate  as  DateTime = DateTime.Now 
cmd.parameters.AddWithValue( letdate, sctDate)


how to save datetime into access with format "dd/MM/yyyy hh:mm:ss"?
i'm try using this format but miss with day and month ..
in my access db using format " dd/mm/yyyy hh:nn:ss "
so i use format like this and haven't miss ..

What I have tried:

dim actdate = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss")


and using save method :

cmd.parameters.Add(New OleDbParameter("letdate", CType(actdate, Date)))

解决方案

Like this:

Dim actDate as DateTime = DateTime.Now
cmd.parameters.AddWithValue("letdate", sctDate)


这篇关于如何将日期时间保存到访问数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆