EXCEL生成SQL建表存储过程的VBA脚本
HO~HO~EXCEL生成SQL建表存储过程的VBA脚本^_^赞一下
2007-12-11 10:39
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 全局变量定义
Const MAX_COLUMN_NUM = 50
Dim stOutputPath As String
Dim stOutputFile As String
Dim stDBName As String
Dim stUserName As String
Dim stUserPasswd As String
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Set InitProcess初始化过程
Public Sub InitProcess()
'初始化输出文件夹
stOutputPath = Application.ThisWorkbook.Path + "\OUTSQL\"
'初始化数据库名
stDBName = Worksheets("首页").Cells(1, 2).Value
If stDBName = "" Then
MsgBox "数据库名不能为空"
Exit Sub
End If
'初始化输出文件名
stOutputFile = stOutputPath & stDBName & "Create.sql"
'创建输出文件夹and文件
On Error Resume Next
If Dir(stOutputPath) = "" Then
MkDir stOutputPath
End If
Dim FileObj, MyFile
Set FileObj = CreateObject("Scripting.FileSystemObject")
If FileObj.FileExists(stOutputFile) Then
Kill stOutputFile
End If
Set MyFile = FileObj.CreateTextFile(stOutputFile, True)
'初始化用户名,用户密码
stUserName = Worksheets("首页").Cells(2, 2).Value
stUserPasswd = Worksheets("首页").Cells(3, 2).Value
End Sub
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 创建数据库函数
Public Sub CreateDbSQL(ByVal OutSq
相关文档:
-- 表的结构 area
DROP TABLE area;
CREATE TABLE area (
id int NOT NULL ,
areaID int NOT NULL,
area varchar(200) NOT NULL,
fatherID int NOT NULL,
PRIMARY KEY (id)
)
DROP TABLE city;
CREATE TABLE city select
id int NOT NULL ......
来自:http://www.cnblogs.com/mikeye/archive/2007/04/13/711878.html
和来自:http://tech.ccidnet.com/art/3539/20080225/1370107_1.html
用eclipse来进行Microsoft SQL Server 2005数据库方面的开发,先把MS SQL Server 2005 JDBC Driver的驱动下载后加入工程文件的类库中;然后写URL字符串。根据以往的写法写入:url = ......
*
提供两种版本的OutLook邮件发送方式
有疑问联系作者: zlp321001@hotmail.com
*/
A:利用OutLook2003发送邮件
----------------------------------------------------------------------
/
*测试环境: windowx Xp
OutLook: OutLook 2003
测试的电子邮件: zlp321001@126.com
/
第一步骤:建配置文件
......
[code]declare @startdt datetime
declare @enddt datetime
select @startdt='2009-12-03',@enddt='2009-12-05'
select * from tb
where 开始日期 between @startdt and @enddt
or 结束日期 between @startdt and @enddt
or @startdt between 开始日期 and 结束日期
or @enddt between 开始日期 and ......