现在我的表序号是个4位的从左往右第一位是代表哪个区的,后三位是代表这个区的具体内容序号,我想插入数据时候自动生成序号,我该怎么弄呢,用的是adotable。
解决方案 »
- 代码意思
- 求思路!用DELPHI6.0开发一个类似SQL SERVER的软件(有实例更好)
- 谁有DCU decompiler 3.2
- chr和ord 处理中文!!!
- 无限制给分::请教使用Delphi已有数据库类搭建大中型软件的数据库框架
- 第一次到这儿,有个小小的问题请大家帮帮忙!
- 听说出了Delphi 7 .net 是真的吗?
- 关于右键弹出菜单:为什么菜单弹出的位置总是和我的鼠标离得十万八千里?
- delphi 打开源码一个控件便消失了,咋回事?
- myobject.free和FreeAndNil(myobject)有什么区别呢?
- 应用程序之间如何实现参数传递
- 谁能给我《商场管理》2.5版的源码和控件,我立马给他1000分,决不食言!!!!!!!!!
Public Function get_CoOutDrictionNo(enterdate As Date)
Dim Label1 As Label
Dim has As Boolean
Dim pub_str3, mon As String
mon = Mid(enterdate, 6, 2)
pub_str1 = "select chr_CoDirectionID from AST_CoDirection where left(chr_CoDirectionID,5)='M" & Right(Year(enterdate), 2) & "" & "" & mon & "' group by chr_CoDirectionID"
init_rst
mod_ast.rst.Open pub_str1, CurrentProject.Connection, adOpenDynamic, adLockBatchOptimistic, adCmdText
If mod_ast.rst.RecordCount = 0 Then
get_CoOutDrictionNo = "M" + Right(Year(enterdate), 2) + mon + "001"
Exit Function
End If
mod_ast.rst.MoveLast
get_CoOutDrictionNo = Left(mod_ast.rst.Fields(0), 5) + Right(Str(Val(Right(Trim(mod_ast.rst.Fields(0)), 3)) + 1001), 3)
End Function