Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create new view with SQL-DMO
Message
From
19/12/2001 11:57:33
 
 
To
19/12/2001 11:18:39
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00596175
Message ID:
00596217
Views:
18
You can use the ExecuteImmediate method (SQLServer object) to set these values on the connection. As long as the connection is open this will take effect for the duration. The T-SQL statements you want to send are:
SET ANSI_WARNINGS ON
SET ANSI_NULLS ON
HTH

>I am trying to create a new view with SQL-DMO. When I actually try to add the view to the views collection, I get an error.
>
>The error is:
>
>The sequence is #7405: Heterogeneous queries require the ANSI_NULLS and ANSI_WARNING options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query....
>
>I am not sure how I am suppose to set these options in SQL-DMO. The error message refers to options of the connection. I don't see a connection object with options to set. How do I set these options in SQL-DMO? The sequence leading to this was:
>
>

>loSqlServer = CREATEOBJECT('SQLDMO.SqlServer')
>loSqlServer.LoginSecure = .T.
>loSqlServer.Connect('WAC_SQL_02')
>loDataBases = loSqlServer.DataBases
>loDataBase = loDataBases.Item['USP']
>loDataBaseViews = loDataBase.Views
>loDataBaseView = loDataBaseViews.Item['ExistingViewName']
>lcText = loDataBaseView.Text
>lcText = STRTRAN(lcText,'ExistingViewName','NewViewName')
>loNewView = CREATEOBJECT("SQLDMO.View")
>loNewView.Name = "NewViewName"
>loNewView.Text = lcText
>loDataBaseViews.Add(loNewView)
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform