📄 11603.html
字号:
<html>
<head>
<title>Re: 请问VB 存取资料库时,有关日期格式的问题(急)</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Re: 请问VB 存取资料库时,有关日期格式的问题(急)</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:svc009@ntut.edu.tw">小飞虾</a> on April 01, 1999 at 16:59:52:<p>
In Reply to: <a href="11500.html">请问VB 存取资料库时,有关日期格式的问题(急)</a> posted by 小黄 on March 30, 1999 at 09:46:47:<p>
你的问题,前阵子我碰过,答案和他差不多。不过我想到一种解决方式:<p>textbox 仍然当做textbox,input text string,在save to database 时执行转换。注意在转入前要check 一下IsDate(txtstring ),有何好意见,请见告。<p>CDateFormat = "ee/mm/dd"<p>Public Function toEDate(txtDate As Variant) As Variant<br>' 民国转换西元<br> Dim i, ee As Long<br> If IsNull(txtDate) Then<br> toEDate = Null<br> ElseIf txtDate = "" Then<br> toEDate = Null<br> Else<br> i = InStr(1, txtDate, "/", vbTextCompare)<br> ee = Val(Left(txtDate, i - 1)) + 1911<br> toEDate = CDate((Str(ee) + Mid(txtDate, i)))<br> End If<br>End Function<p>Public Function toCDate(dtmDate) As String<br>' 西元转民国<br> If IsNull(dtmDate) Then<br> toCDate = ""<br> Else<br> toCDate = Format(dtmDate, CDateFormat)<br> End If<br>End Function<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 11603-->
</ul><!--end: 11603-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -