Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
About SQLDMO
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Titre:
Divers
Thread ID:
00880584
Message ID:
00880739
Vues:
19
Hi Nicholas,

Two things to check:
1) Be certain all of your objects actually instantiated (check them with TYPE() or ISNULL() function).
2) Try capitalizing PRIMARY in your oDatabase.FileGroups('Primary').DbFiles.add(oDataFile) statement (don't know exactly why, but that helped me one other time).

Just some initial thoughts...HTH.

>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 .
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform