Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create new view with SQL-DMO
Message
From
20/12/2001 15:27:31
 
 
To
20/12/2001 12:52:54
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00596175
Message ID:
00596980
Views:
28
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)
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform