General information
Forum:
Microsoft SQL Server
Category:
Database management
Dear All,
I wish to create MsSQL database by using SQLDMO object. But it keep prompt me error. I cann't found which part cause the error and where can i get more example about SQLDMO object for visual foxpro.
Can anyone give me a advice ?
oSQLServer = CREATEOBJECT('SQLDMO.SQLSERVER')
oSQLServer.connect('MyServer','SA','SA')
oDatabase = CREATEOBJECT('SQLDMO.Database')
oDataFile = CREATEOBJECT('SQLDMO.DBFile')
oLogFile = CREATEOBJECT('SQLDMO.logFile')
oDatabase.Name = 'MyExample'
*Define the primary file
oDataFile.Name = 'CSdata1'
oDataFile.PhysicalName = "\\MyServer\MSSQL\Data\CsData1.MDF"
oDatafile.PrimaryFile = .T.
oDataFile.fileGrowthtype = 0
oDataFile.FileGrowth = 1
oDatabase.FileGroups('Primary').DbFiles.add(oDataFile)
*Define the transaction log file
ologfile.Name = 'cslog1'
ologfile.PhysicalName = '\\MyServer\MSSQL\data\cslog1.LDF'
oDatabase.TransactionLog.LogFiles.add(oLogFile)
oSQlServer.databases.add (oDatabase)
Error Msg = OLE Dispatch Exception Code 5110
Thank you .
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only