Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
About SQLDMO
Message
From
24/02/2004 23:36:40
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Database management
Title:
About SQLDMO
Miscellaneous
Thread ID:
00880584
Message ID:
00880584
Views:
48
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
Map
View

Click here to load this message in the networking platform