<% ************ Create ************************************************** = "CodeCreatedB using AdoDb.Connect object "Set Oconn = Server.createObject (" adoDb.connection "Oconn.open" provider = SQLOLEDB; DATA SOURCE = (local); user ID = sa; password =; "Oconn.execute" Create Database "& sdatabaseName%> Method Two: <% @ language = VBScript%> <% ***************************************************************** ***** Dim oSQLServerDim oDatabaseDim oDBFileDataDim oLogFileDim sDatabaseNameDim sDatapath database name sDatabaseName = "CodeCreateDBTest" data file path sDatapath = "D: /" create Sql Server objects and links, (local) for the Server name at Set oSQLServer = Server. CreateObject ( "SQLDMO.SQLServer") oSQLServer.LoginSecure = True use integrated authentication integrated security oSQLServer.Connect "(local)" oSQLServer.Connect "(local)", "sa", "" use the standard verification standard security to create Database objects Set oDatabase = Server.CreateObject ( "SQLDMO.Database") oDatabase.Name = sDatabaseName create db file objects Set oDBFileData = Server.CreateObject ( "SQLDMO.DBFile") With oDBFileData .Name = sDatabaseName & "_data" .PhysicalName = sDatapath & "/" & sDatabaseName & "_data.mdf" .PrimaryFile = True .FileGrowthType = SQLDMOGrowth_MB .FileGrowth = 1End With create a log file objects Set oLogFile = Server.CreateObject ( "SQLDMO.LogFile") With oLogFile .Name = SDATABASENAME & "_log" .physicalname = sdataPath & "& SDatabaseName &" _log.ldf "End with DB file object and log file object Add to Database database object odatabase.filegroups (" primary "