在asp 中使用 sql_dmo 添加新数据库__教程 |
|
日期:2007-5-20 1:23:04 人气:39 [大 中 小] |
|
|
|
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 files\microsoft sql server\mssql\data\test.mdf" oDBFileData.PrimaryFile = True oDBFileData.FileGrowthType = SQLDMOGrowth_MB oDBFileData.FileGrowth = 1
oDatabase.FileGroups("PRIMARY").DBFiles.Add oDBFileData
oLogFile.Name = "test1" oLogFile.PhysicalName = "c:\program files\microsoft sql server\mssql\data\test.ldf" oDatabase.TransactionLog.LogFiles.Add oLogFile
oSQLServer.Databases.Add oDatabase |
|
出处:本站原创 作者:佚名 |
|
|