最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
在asp 中使用 sql_dmo 添加新数据库
时间:2022-06-30 10:47:30 编辑:袖梨 来源:一聚教程网
set oSQLServer =server.createobject("SQLDMO.SQLServer")
oSQLServer.Connect "数据库IP,端口","用户名","密码" ' 连接数据库
set oSQLServer =server.createobject("SQLDMO.Database")
set oDBFileData =server.createobject("SQLDMO.DBFile")
set oLogFile =server.createobject("SQLDMO.LogFile")
oDatabase.Name = "test"
oDBFileData.Name = "test1"
oDBFileData.PhysicalName = "c:program filesmicrosoft sql servermssqldata est.mdf"
oDBFileData.PrimaryFile = True
oDBFileData.FileGrowthType = SQLDMOGrowth_MB
oDBFileData.FileGrowth = 1
oDatabase.FileGroups("PRIMARY").DBFiles.Add oDBFileData
oLogFile.Name = "test1"
oLogFile.PhysicalName = "c:program filesmicrosoft sql servermssqldata est.ldf"
oDatabase.TransactionLog.LogFiles.Add oLogFile
oSQLServer.Databases.Add oDatabase
oSQLServer.Connect "数据库IP,端口","用户名","密码" ' 连接数据库
set oSQLServer =server.createobject("SQLDMO.Database")
set oDBFileData =server.createobject("SQLDMO.DBFile")
set oLogFile =server.createobject("SQLDMO.LogFile")
oDatabase.Name = "test"
oDBFileData.Name = "test1"
oDBFileData.PhysicalName = "c:program filesmicrosoft sql servermssqldata est.mdf"
oDBFileData.PrimaryFile = True
oDBFileData.FileGrowthType = SQLDMOGrowth_MB
oDBFileData.FileGrowth = 1
oDatabase.FileGroups("PRIMARY").DBFiles.Add oDBFileData
oLogFile.Name = "test1"
oLogFile.PhysicalName = "c:program filesmicrosoft sql servermssqldata est.ldf"
oDatabase.TransactionLog.LogFiles.Add oLogFile
oSQLServer.Databases.Add oDatabase
相关文章
- 人们熟悉的寄居蟹属于以下哪种分类 神奇海洋11月21日答案 11-21
- 第五人格11.22共研服有什么更新 11月22日共研服更新内容介绍 11-21
- 原神恰斯卡怎么培养 11-21
- 无期迷途四星装束是谁 11-21
- 王者荣耀帝丹高中校服怎么获得 11-21
- 光遇姆明季后续版本怎么玩 11-21