Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create new view with SQL-DMO
Message
De
20/12/2001 15:27:31
 
 
À
20/12/2001 12:52:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00596175
Message ID:
00596980
Vues:
39
This message has been marked as the solution to the initial question of the thread.
My bad. These settings apply to the database, so you need to use the ExecuteImmediate on the database object instead. If you want to use the SQL Server object you can call the sp_dboption stored procedure which lets you specify the database.

>Still receiving the error. The routine now looks like:
>
>
>loSqlServer = CREATEOBJECT('SQLDMO.SqlServer')
>loSqlServer.LoginSecure = .T.
>loSqlServer.Connect('WAC_SQL_02')
>loSQLServer.ExecuteImmediate('SET QUOTED_IDENTIFIER OFF')
>loSQLServer.ExecuteImmediate('SET ANSI_WARNINGS OFF')
>loSQLServer.ExecuteImmediate('SET ANSI_NULLS ON')
>loSQLServer.AnsiNulls = .T.
>
>loDataBases = loSqlServer.DataBases
>loDataBase = loDataBases.Item['USP']
>loDataBaseViews = loDataBase.Views
>loDataBaseView = loDataBaseViews.Item['OldViewName']
>lcText = loDataBaseView.text
>lcText = STRTRAN(lcText,"OldViewName","NewViewName")
>lctext = STRTRAN(lctext,"0102004","0009019")
>
>loNewView = CREATEOBJECT('SQLDMO.View')
>loNewView.Name = 'NewViewName'
>loNewView.text = lctext
>loNewView.Owner = 'dbo'
>loNewView.AnsiNullsStatus = .T.
>
>loDataBaseViews.Add(loNewView)
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform