I have an application writing in VFP that is used to manage some database
processes, some of these processes are currently writing in DMO. We are in
the process of upgrading to sql 2005 and I’m running into some trouble. I
m
currently changing some of the process to t-sql statements but I have an
issue where I think I need to use DMO. I’ve installed the backwards
compatible objects but I can not seem to connect via DMO. I have a default
instance of sql 2000, a named instance 2000 and a named instance of 2005
running on laptop running XP Tablet edition.
Code
ox= CREATEOBJECT("SQLDMO.sqlServer")
?ox.Connect("MA-ENG-PCANINO2\sql2005","sa", "SASA")
Executing that returns this error.
OLE IDispatch exception code 55555 from Microsoft SQL-DMO (ODBC SQLState:
42000): [Microsoft][ODBC SQL Server Driver][SQL Server]To connect to this
server you must use SQL Server Management Studio or SQL Server Management
Objects (SMO)...
Thank you in advance.
Pauly CIt’s working now, I read in another post to unregistered and reregister th
e
SQLDMO.dll - \\Program Files\Microsoft SQL Server\80\Tools\Binn\SQLDMO.dll.
I did just that and now I’m able to successfully connect to SQL 2005 via D
MO.
YIPPEE
"Pauly C" wrote:
> I have an application writing in VFP that is used to manage some database
> processes, some of these processes are currently writing in DMO. We are i
n
> the process of upgrading to sql 2005 and I’m running into some trouble.
I’m
> currently changing some of the process to t-sql statements but I have an
> issue where I think I need to use DMO. I’ve installed the backwards
> compatible objects but I can not seem to connect via DMO. I have a defaul
t
> instance of sql 2000, a named instance 2000 and a named instance of 2005
> running on laptop running XP Tablet edition.
> Code
> ox= CREATEOBJECT("SQLDMO.sqlServer")
> ?ox.Connect("MA-ENG-PCANINO2\sql2005","sa", "SASA")
> Executing that returns this error.
> OLE IDispatch exception code 55555 from Microsoft SQL-DMO (ODBC SQLState:
> 42000): [Microsoft][ODBC SQL Server Driver][SQL Server]To connect to this
> server you must use SQL Server Management Studio or SQL Server Management
> Objects (SMO)...
> Thank you in advance.
> Pauly C
>
Showing posts with label writing. Show all posts
Showing posts with label writing. Show all posts
Monday, March 19, 2012
DMO, VFP and SQL 2005
DMo Example of merge replication
I purchased the SQL DMO book that Mark Allison participated in writing. I
read the chapter on merge replication , however, the chapter only discusses
the setup / config of merge replication. I am interested in the code where a
user would click a button and start a pull subscription. Does anyone have
any examples to share or guidance?
Paul - the first link doesn't work and the second one is a link to info about
the ActiveX object.
I am looking for info specifically on SQL DMO and merge replication.
Any other ideas?
"MSSQLServerDeveloper" wrote:
> I purchased the SQL DMO book that Mark Allison participated in writing. I
> read the chapter on merge replication , however, the chapter only discusses
> the setup / config of merge replication. I am interested in the code where a
> user would click a button and start a pull subscription. Does anyone have
> any examples to share or guidance?
>
|||The first link works - it's just that the text has wrapped in the message. I
don't know of a specifically SQLDMO script which initializes or synchronizes
replication, but the ActiveX object is designed for specifically this use.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||try something like this
Option explicit
Const SQLDMOSubscription_Anonymous = 2
Const SQLDMOReplSecurity_Normal = 0
Const SQLDMOReplSecurity_Integrated = 1
Const SQLDMOSubscription_All = 3
Const SQLDMOMergeSubscriber_Default = 2
dim objServer,objReplication,objReplicationDatabases,o bjReplicationDatabase,
objMergePullSubscription,objMergePullSubscriptions , objReplicationSecurity
set objServer = CreateObject("SQLDMO.SQLServer")
objServer.Connect
"SubscriberServerName","sa","PaulIbisonIsADoofusAn dHeDancesLikeAGurl"
set objReplication=objServer.Replication
set objReplicationDatabases=objReplication.Replication Databases
set objReplicationDatabase=objReplicationDatabases("su b")
set objMergePullSubscription=CreateObject("SQLDMO.Merg ePullSubscription2")
set objReplicationSecurity=objMergePullSubscription.Di stributorSecurity
objReplicationSecurity.SecurityMode=SQLDMOReplSecu rity_Normal
objReplicationSecurity.StandardLogin="sa"
objReplicationSecurity.StandardPassword="PaulIbiso nIsADoofusAndHeDancesLikeA
Gurl"
with objMergePullSubscription
.AltSnapshotFolder="C:\temp\"
.Distributor="PublisherServerName"
.DistributorSecurity.SecurityMode=SQLDMOReplSecuri ty_Normal
.DistributorSecurity.StandardLogin="sa"
..DistributorSecurity.StandardPassword="PaulIbison IsADoofusAndHeDancesLikeAGu
rl"
.Publisher= "PublisherServerName"
.PublicationDB="pubs"
.Publication="test"
.PublisherSecurity.SecurityMode=SQLDMOReplSecurity _Normal
.PublisherSecurity.StandardLogin="sa"
.PublisherSecurity.StandardPassword="se1cure#"
.SubscriberType =SQLDMOMergeSubscriber_Default
.SubscriptionType = SQLDMOSubscription_Anonymous
.SubscriberSecurityMode=SQLDMOReplSecurity_Normal
.SubscriberLogin="sa"
.SubscriberPassword="PaulIbisonIsADoofusAndHeDance sLikeAGurl"
.UseFTP=False
end with
set objMergePullSubscriptions=objReplicationDatabase.M ergePullSubscriptions
objMergePullSubscriptions.Add objMergePullSubscription
set objMergePullSubscription=Nothing
set objMergePullSubscriptions=Nothing
set objReplicationDatabases=Nothing
set objReplication=Nothing
set objServer=Nothing
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"MSSQLServerDeveloper" <MSSQLServerDeveloper@.discussions.microsoft.com>
wrote in message news:AAE00CF7-C4FD-48D2-A815-FF60B824D249@.microsoft.com...
> I purchased the SQL DMO book that Mark Allison participated in writing. I
> read the chapter on merge replication , however, the chapter only
discusses
> the setup / config of merge replication. I am interested in the code
where a
> user would click a button and start a pull subscription. Does anyone have
> any examples to share or guidance?
>
|||Hilary - Thanks very much - I'll give it a try. Not til next week, but I
will keep you posted. Regards
"Hilary Cotter" wrote:
> try something like this
> Option explicit
> Const SQLDMOSubscription_Anonymous = 2
> Const SQLDMOReplSecurity_Normal = 0
> Const SQLDMOReplSecurity_Integrated = 1
> Const SQLDMOSubscription_All = 3
> Const SQLDMOMergeSubscriber_Default = 2
> dim objServer,objReplication,objReplicationDatabases,o bjReplicationDatabase,
> objMergePullSubscription,objMergePullSubscriptions , objReplicationSecurity
> set objServer = CreateObject("SQLDMO.SQLServer")
> objServer.Connect
> "SubscriberServerName","sa","PaulIbisonIsADoofusAn dHeDancesLikeAGurl"
> set objReplication=objServer.Replication
> set objReplicationDatabases=objReplication.Replication Databases
> set objReplicationDatabase=objReplicationDatabases("su b")
> set objMergePullSubscription=CreateObject("SQLDMO.Merg ePullSubscription2")
> set objReplicationSecurity=objMergePullSubscription.Di stributorSecurity
> objReplicationSecurity.SecurityMode=SQLDMOReplSecu rity_Normal
> objReplicationSecurity.StandardLogin="sa"
> objReplicationSecurity.StandardPassword="PaulIbiso nIsADoofusAndHeDancesLikeA
> Gurl"
> with objMergePullSubscription
> .AltSnapshotFolder="C:\temp\"
> .Distributor="PublisherServerName"
> .DistributorSecurity.SecurityMode=SQLDMOReplSecuri ty_Normal
> .DistributorSecurity.StandardLogin="sa"
> ..DistributorSecurity.StandardPassword="PaulIbison IsADoofusAndHeDancesLikeAGu
> rl"
> .Publisher= "PublisherServerName"
> .PublicationDB="pubs"
> .Publication="test"
> .PublisherSecurity.SecurityMode=SQLDMOReplSecurity _Normal
> .PublisherSecurity.StandardLogin="sa"
> .PublisherSecurity.StandardPassword="se1cure#"
> .SubscriberType =SQLDMOMergeSubscriber_Default
> .SubscriptionType = SQLDMOSubscription_Anonymous
> .SubscriberSecurityMode=SQLDMOReplSecurity_Normal
> .SubscriberLogin="sa"
> .SubscriberPassword="PaulIbisonIsADoofusAndHeDance sLikeAGurl"
> .UseFTP=False
> end with
> set objMergePullSubscriptions=objReplicationDatabase.M ergePullSubscriptions
> objMergePullSubscriptions.Add objMergePullSubscription
> set objMergePullSubscription=Nothing
> set objMergePullSubscriptions=Nothing
> set objReplicationDatabases=Nothing
> set objReplication=Nothing
> set objServer=Nothing
>
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> "MSSQLServerDeveloper" <MSSQLServerDeveloper@.discussions.microsoft.com>
> wrote in message news:AAE00CF7-C4FD-48D2-A815-FF60B824D249@.microsoft.com...
> discusses
> where a
>
>
|||btw - I like the password.
"Hilary Cotter" wrote:
> try something like this
> Option explicit
> Const SQLDMOSubscription_Anonymous = 2
> Const SQLDMOReplSecurity_Normal = 0
> Const SQLDMOReplSecurity_Integrated = 1
> Const SQLDMOSubscription_All = 3
> Const SQLDMOMergeSubscriber_Default = 2
> dim objServer,objReplication,objReplicationDatabases,o bjReplicationDatabase,
> objMergePullSubscription,objMergePullSubscriptions , objReplicationSecurity
> set objServer = CreateObject("SQLDMO.SQLServer")
> objServer.Connect
> "SubscriberServerName","sa","PaulIbisonIsADoofusAn dHeDancesLikeAGurl"
> set objReplication=objServer.Replication
> set objReplicationDatabases=objReplication.Replication Databases
> set objReplicationDatabase=objReplicationDatabases("su b")
> set objMergePullSubscription=CreateObject("SQLDMO.Merg ePullSubscription2")
> set objReplicationSecurity=objMergePullSubscription.Di stributorSecurity
> objReplicationSecurity.SecurityMode=SQLDMOReplSecu rity_Normal
> objReplicationSecurity.StandardLogin="sa"
> objReplicationSecurity.StandardPassword="PaulIbiso nIsADoofusAndHeDancesLikeA
> Gurl"
> with objMergePullSubscription
> .AltSnapshotFolder="C:\temp\"
> .Distributor="PublisherServerName"
> .DistributorSecurity.SecurityMode=SQLDMOReplSecuri ty_Normal
> .DistributorSecurity.StandardLogin="sa"
> ..DistributorSecurity.StandardPassword="PaulIbison IsADoofusAndHeDancesLikeAGu
> rl"
> .Publisher= "PublisherServerName"
> .PublicationDB="pubs"
> .Publication="test"
> .PublisherSecurity.SecurityMode=SQLDMOReplSecurity _Normal
> .PublisherSecurity.StandardLogin="sa"
> .PublisherSecurity.StandardPassword="se1cure#"
> .SubscriberType =SQLDMOMergeSubscriber_Default
> .SubscriptionType = SQLDMOSubscription_Anonymous
> .SubscriberSecurityMode=SQLDMOReplSecurity_Normal
> .SubscriberLogin="sa"
> .SubscriberPassword="PaulIbisonIsADoofusAndHeDance sLikeAGurl"
> .UseFTP=False
> end with
> set objMergePullSubscriptions=objReplicationDatabase.M ergePullSubscriptions
> objMergePullSubscriptions.Add objMergePullSubscription
> set objMergePullSubscription=Nothing
> set objMergePullSubscriptions=Nothing
> set objReplicationDatabases=Nothing
> set objReplication=Nothing
> set objServer=Nothing
>
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> "MSSQLServerDeveloper" <MSSQLServerDeveloper@.discussions.microsoft.com>
> wrote in message news:AAE00CF7-C4FD-48D2-A815-FF60B824D249@.microsoft.com...
> discusses
> where a
>
>
|||Hilary,
what makes me think you're getting that Friday feeling?
Paul
|||was it the virus I emailed you? The postings I have being doing in your name
in alt.bedwetting? The huge amount of spam I have been sending out in your
name?
Please help me figure this one out?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:071101c4ffe3$937a9580$a501280a@.phx.gbl...
> Hilary,
> what makes me think you're getting that Friday feeling?
> Paul
|||Ah,
so you're the reason I keep getting orders for caseloads
of Viagra and penile extension operations. Might have
known. Anyway, must dash - it's 7:15 on Friday evening,
there's nobody else here and I'm the mug who'se doing the
database rollouts.
Paul
|||um...that wasn't me - must have been your wife!
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Paul" <anonymous@.discussions.microsoft.com> wrote in message
news:077b01c4ffed$3e18a0f0$a501280a@.phx.gbl...
> Ah,
> so you're the reason I keep getting orders for caseloads
> of Viagra and penile extension operations. Might have
> known. Anyway, must dash - it's 7:15 on Friday evening,
> there's nobody else here and I'm the mug who'se doing the
> database rollouts.
> Paul
>
read the chapter on merge replication , however, the chapter only discusses
the setup / config of merge replication. I am interested in the code where a
user would click a button and start a pull subscription. Does anyone have
any examples to share or guidance?
Paul - the first link doesn't work and the second one is a link to info about
the ActiveX object.
I am looking for info specifically on SQL DMO and merge replication.
Any other ideas?
"MSSQLServerDeveloper" wrote:
> I purchased the SQL DMO book that Mark Allison participated in writing. I
> read the chapter on merge replication , however, the chapter only discusses
> the setup / config of merge replication. I am interested in the code where a
> user would click a button and start a pull subscription. Does anyone have
> any examples to share or guidance?
>
|||The first link works - it's just that the text has wrapped in the message. I
don't know of a specifically SQLDMO script which initializes or synchronizes
replication, but the ActiveX object is designed for specifically this use.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||try something like this
Option explicit
Const SQLDMOSubscription_Anonymous = 2
Const SQLDMOReplSecurity_Normal = 0
Const SQLDMOReplSecurity_Integrated = 1
Const SQLDMOSubscription_All = 3
Const SQLDMOMergeSubscriber_Default = 2
dim objServer,objReplication,objReplicationDatabases,o bjReplicationDatabase,
objMergePullSubscription,objMergePullSubscriptions , objReplicationSecurity
set objServer = CreateObject("SQLDMO.SQLServer")
objServer.Connect
"SubscriberServerName","sa","PaulIbisonIsADoofusAn dHeDancesLikeAGurl"
set objReplication=objServer.Replication
set objReplicationDatabases=objReplication.Replication Databases
set objReplicationDatabase=objReplicationDatabases("su b")
set objMergePullSubscription=CreateObject("SQLDMO.Merg ePullSubscription2")
set objReplicationSecurity=objMergePullSubscription.Di stributorSecurity
objReplicationSecurity.SecurityMode=SQLDMOReplSecu rity_Normal
objReplicationSecurity.StandardLogin="sa"
objReplicationSecurity.StandardPassword="PaulIbiso nIsADoofusAndHeDancesLikeA
Gurl"
with objMergePullSubscription
.AltSnapshotFolder="C:\temp\"
.Distributor="PublisherServerName"
.DistributorSecurity.SecurityMode=SQLDMOReplSecuri ty_Normal
.DistributorSecurity.StandardLogin="sa"
..DistributorSecurity.StandardPassword="PaulIbison IsADoofusAndHeDancesLikeAGu
rl"
.Publisher= "PublisherServerName"
.PublicationDB="pubs"
.Publication="test"
.PublisherSecurity.SecurityMode=SQLDMOReplSecurity _Normal
.PublisherSecurity.StandardLogin="sa"
.PublisherSecurity.StandardPassword="se1cure#"
.SubscriberType =SQLDMOMergeSubscriber_Default
.SubscriptionType = SQLDMOSubscription_Anonymous
.SubscriberSecurityMode=SQLDMOReplSecurity_Normal
.SubscriberLogin="sa"
.SubscriberPassword="PaulIbisonIsADoofusAndHeDance sLikeAGurl"
.UseFTP=False
end with
set objMergePullSubscriptions=objReplicationDatabase.M ergePullSubscriptions
objMergePullSubscriptions.Add objMergePullSubscription
set objMergePullSubscription=Nothing
set objMergePullSubscriptions=Nothing
set objReplicationDatabases=Nothing
set objReplication=Nothing
set objServer=Nothing
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"MSSQLServerDeveloper" <MSSQLServerDeveloper@.discussions.microsoft.com>
wrote in message news:AAE00CF7-C4FD-48D2-A815-FF60B824D249@.microsoft.com...
> I purchased the SQL DMO book that Mark Allison participated in writing. I
> read the chapter on merge replication , however, the chapter only
discusses
> the setup / config of merge replication. I am interested in the code
where a
> user would click a button and start a pull subscription. Does anyone have
> any examples to share or guidance?
>
|||Hilary - Thanks very much - I'll give it a try. Not til next week, but I
will keep you posted. Regards
"Hilary Cotter" wrote:
> try something like this
> Option explicit
> Const SQLDMOSubscription_Anonymous = 2
> Const SQLDMOReplSecurity_Normal = 0
> Const SQLDMOReplSecurity_Integrated = 1
> Const SQLDMOSubscription_All = 3
> Const SQLDMOMergeSubscriber_Default = 2
> dim objServer,objReplication,objReplicationDatabases,o bjReplicationDatabase,
> objMergePullSubscription,objMergePullSubscriptions , objReplicationSecurity
> set objServer = CreateObject("SQLDMO.SQLServer")
> objServer.Connect
> "SubscriberServerName","sa","PaulIbisonIsADoofusAn dHeDancesLikeAGurl"
> set objReplication=objServer.Replication
> set objReplicationDatabases=objReplication.Replication Databases
> set objReplicationDatabase=objReplicationDatabases("su b")
> set objMergePullSubscription=CreateObject("SQLDMO.Merg ePullSubscription2")
> set objReplicationSecurity=objMergePullSubscription.Di stributorSecurity
> objReplicationSecurity.SecurityMode=SQLDMOReplSecu rity_Normal
> objReplicationSecurity.StandardLogin="sa"
> objReplicationSecurity.StandardPassword="PaulIbiso nIsADoofusAndHeDancesLikeA
> Gurl"
> with objMergePullSubscription
> .AltSnapshotFolder="C:\temp\"
> .Distributor="PublisherServerName"
> .DistributorSecurity.SecurityMode=SQLDMOReplSecuri ty_Normal
> .DistributorSecurity.StandardLogin="sa"
> ..DistributorSecurity.StandardPassword="PaulIbison IsADoofusAndHeDancesLikeAGu
> rl"
> .Publisher= "PublisherServerName"
> .PublicationDB="pubs"
> .Publication="test"
> .PublisherSecurity.SecurityMode=SQLDMOReplSecurity _Normal
> .PublisherSecurity.StandardLogin="sa"
> .PublisherSecurity.StandardPassword="se1cure#"
> .SubscriberType =SQLDMOMergeSubscriber_Default
> .SubscriptionType = SQLDMOSubscription_Anonymous
> .SubscriberSecurityMode=SQLDMOReplSecurity_Normal
> .SubscriberLogin="sa"
> .SubscriberPassword="PaulIbisonIsADoofusAndHeDance sLikeAGurl"
> .UseFTP=False
> end with
> set objMergePullSubscriptions=objReplicationDatabase.M ergePullSubscriptions
> objMergePullSubscriptions.Add objMergePullSubscription
> set objMergePullSubscription=Nothing
> set objMergePullSubscriptions=Nothing
> set objReplicationDatabases=Nothing
> set objReplication=Nothing
> set objServer=Nothing
>
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> "MSSQLServerDeveloper" <MSSQLServerDeveloper@.discussions.microsoft.com>
> wrote in message news:AAE00CF7-C4FD-48D2-A815-FF60B824D249@.microsoft.com...
> discusses
> where a
>
>
|||btw - I like the password.
"Hilary Cotter" wrote:
> try something like this
> Option explicit
> Const SQLDMOSubscription_Anonymous = 2
> Const SQLDMOReplSecurity_Normal = 0
> Const SQLDMOReplSecurity_Integrated = 1
> Const SQLDMOSubscription_All = 3
> Const SQLDMOMergeSubscriber_Default = 2
> dim objServer,objReplication,objReplicationDatabases,o bjReplicationDatabase,
> objMergePullSubscription,objMergePullSubscriptions , objReplicationSecurity
> set objServer = CreateObject("SQLDMO.SQLServer")
> objServer.Connect
> "SubscriberServerName","sa","PaulIbisonIsADoofusAn dHeDancesLikeAGurl"
> set objReplication=objServer.Replication
> set objReplicationDatabases=objReplication.Replication Databases
> set objReplicationDatabase=objReplicationDatabases("su b")
> set objMergePullSubscription=CreateObject("SQLDMO.Merg ePullSubscription2")
> set objReplicationSecurity=objMergePullSubscription.Di stributorSecurity
> objReplicationSecurity.SecurityMode=SQLDMOReplSecu rity_Normal
> objReplicationSecurity.StandardLogin="sa"
> objReplicationSecurity.StandardPassword="PaulIbiso nIsADoofusAndHeDancesLikeA
> Gurl"
> with objMergePullSubscription
> .AltSnapshotFolder="C:\temp\"
> .Distributor="PublisherServerName"
> .DistributorSecurity.SecurityMode=SQLDMOReplSecuri ty_Normal
> .DistributorSecurity.StandardLogin="sa"
> ..DistributorSecurity.StandardPassword="PaulIbison IsADoofusAndHeDancesLikeAGu
> rl"
> .Publisher= "PublisherServerName"
> .PublicationDB="pubs"
> .Publication="test"
> .PublisherSecurity.SecurityMode=SQLDMOReplSecurity _Normal
> .PublisherSecurity.StandardLogin="sa"
> .PublisherSecurity.StandardPassword="se1cure#"
> .SubscriberType =SQLDMOMergeSubscriber_Default
> .SubscriptionType = SQLDMOSubscription_Anonymous
> .SubscriberSecurityMode=SQLDMOReplSecurity_Normal
> .SubscriberLogin="sa"
> .SubscriberPassword="PaulIbisonIsADoofusAndHeDance sLikeAGurl"
> .UseFTP=False
> end with
> set objMergePullSubscriptions=objReplicationDatabase.M ergePullSubscriptions
> objMergePullSubscriptions.Add objMergePullSubscription
> set objMergePullSubscription=Nothing
> set objMergePullSubscriptions=Nothing
> set objReplicationDatabases=Nothing
> set objReplication=Nothing
> set objServer=Nothing
>
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> "MSSQLServerDeveloper" <MSSQLServerDeveloper@.discussions.microsoft.com>
> wrote in message news:AAE00CF7-C4FD-48D2-A815-FF60B824D249@.microsoft.com...
> discusses
> where a
>
>
|||Hilary,
what makes me think you're getting that Friday feeling?
Paul
|||was it the virus I emailed you? The postings I have being doing in your name
in alt.bedwetting? The huge amount of spam I have been sending out in your
name?
Please help me figure this one out?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:071101c4ffe3$937a9580$a501280a@.phx.gbl...
> Hilary,
> what makes me think you're getting that Friday feeling?
> Paul
|||Ah,
so you're the reason I keep getting orders for caseloads
of Viagra and penile extension operations. Might have
known. Anyway, must dash - it's 7:15 on Friday evening,
there's nobody else here and I'm the mug who'se doing the
database rollouts.
Paul
|||um...that wasn't me - must have been your wife!
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Paul" <anonymous@.discussions.microsoft.com> wrote in message
news:077b01c4ffed$3e18a0f0$a501280a@.phx.gbl...
> Ah,
> so you're the reason I keep getting orders for caseloads
> of Viagra and penile extension operations. Might have
> known. Anyway, must dash - it's 7:15 on Friday evening,
> there's nobody else here and I'm the mug who'se doing the
> database rollouts.
> Paul
>
Sunday, March 11, 2012
dll & Web Service in VB.Net 2005 Stored Procedure
Hi,
I am writing a vb.net2005 program that needs to create a stored procedure
with SqlServerProject Template.
Now, I have two questions for this stored procedure.
1) How can I import and execute the .dll in this Stored Procedures?
2) How can I connect the Web Service and get the result in this Stored
Procedures?
---
Partial Public Class StoredProcedures1
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub GetTable()
Dim strSQL As String = "SELECT * FROM Table1"
Using conn As New SqlConnection("context connection=true")
Using cmd As New SqlCommand
With cmd
.Connection = conn
.CommandText = strSQL
.CommandType = CommandType.Text
conn.Open()
SqlContext.Pipe.ExecuteAndSend(cmd)
.Connection.Close()
End With
End Using
End Using
End Sub
End Class
---
Thanks!"James Wong" <cphk_msdn@.nospam.nospam> wrote in message
news:u155F84iGHA.1260@.TK2MSFTNGP05.phx.gbl...
> Hi,
> I am writing a vb.net2005 program that needs to create a stored procedure
> with SqlServerProject Template.
> Now, I have two questions for this stored procedure.
> 1) How can I import and execute the .dll in this Stored Procedures?
You need to deploy the assembly into your database (CREATE ASSEMBLY) and
then add a stored procedure referencing the method in the assembly (CREATE
PROCEDURE). Visual Studio will do this for you if you right-click on the
project and select Deploy.
Here's how you would do it by hand:
CREATE ASSEMBLY [SqlServerProject2]
FROM 'c:\SqlServerProject2.dll'
WITH PERMISSION_SET = SAFE
GO
CREATE PROCEDURE [GetTable]
AS
EXTERNAL NAME
[SqlServerProject2].[SqlServerProject2.StoredProcedures].[GetTable]
> 2) How can I connect the Web Service and get the result in this Stored
> Procedures?
>
From the web service just connect to the database and execute it with a
SqlCommand.
David|||Hi David,
sorry, i think that u were misunderstood my problem.
My Stored Procedure "StoredProcedures1.GetTable()" is need to call another
.dll & web service to get some value.
Thanks
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> glsD:O3xF9H5iGHA.45
04@.TK2MSFTNGP05.phx.gbl...
> "James Wong" <cphk_msdn@.nospam.nospam> wrote in message
> news:u155F84iGHA.1260@.TK2MSFTNGP05.phx.gbl...
> You need to deploy the assembly into your database (CREATE ASSEMBLY) and
> then add a stored procedure referencing the method in the assembly (CREATE
> PROCEDURE). Visual Studio will do this for you if you right-click on the
> project and select Deploy.
> Here's how you would do it by hand:
> CREATE ASSEMBLY [SqlServerProject2]
> FROM 'c:\SqlServerProject2.dll'
> WITH PERMISSION_SET = SAFE
> GO
> CREATE PROCEDURE [GetTable]
> AS
> EXTERNAL NAME
> [SqlServerProject2].[SqlServerProject2.StoredProcedures].[GetTable]
>
> From the web service just connect to the database and execute it with a
> SqlCommand.
> David
>|||"James Wong" <cphk_msdn@.nospam.nospam> wrote in message
news:eWXrxU5iGHA.412@.TK2MSFTNGP05.phx.gbl...
> Hi David,
> sorry, i think that u were misunderstood my problem.
> My Stored Procedure "StoredProcedures1.GetTable()" is need to call another
> .dll & web service to get some value.
>
To use another .dll add a reference to your database project. To use a web
service add a web reference.
David|||Hi David,
1) For DLL, VS.Net 2005 is not allow me to import a new References in
SqlServerProject Template.
2) For Web Service, it will occur error when running.
----
--
Partial Public Class StoredProcedures
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub SPWithWebService()
Dim WebService As New SqlServerProject1.localhost.Service
Dim msg As String = CStr(WebService.HelloWorld())
SqlContext.Pipe.Send(msg)
End Sub
End Class
----
--
Thanks
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> glsD:OqYxDh5iGHA.34
96@.TK2MSFTNGP04.phx.gbl...
> "James Wong" <cphk_msdn@.nospam.nospam> wrote in message
> news:eWXrxU5iGHA.412@.TK2MSFTNGP05.phx.gbl...
> To use another .dll add a reference to your database project. To use a
> web service add a web reference.
> David
>|||Hello James,
When you are using the VS SQL Server Project you are restricted to what
assemblies you can reference. This behavior is by design. However, you
could create a normal class library project, add references as per usual
and then manually create your assembly through CREATE ASSEMBLY. Make sure
your referenced
assemblies are in the same directory as your user assembly.
If you want to use the VS SQL Server Project you can create the assembly
you want to reference in the database before you try to reference it. You
need do a manual CREATE ASSEMBLY against the DLL you want.
As for Web service , you will also need to use the CLR SDK tool SGEN.EXE to
create and register a helper assembly for the assembly generated by WSDL,
as described in:
http://blogs.msdn.com/sqlclr/archiv.../25/Vineet.aspx
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
I am writing a vb.net2005 program that needs to create a stored procedure
with SqlServerProject Template.
Now, I have two questions for this stored procedure.
1) How can I import and execute the .dll in this Stored Procedures?
2) How can I connect the Web Service and get the result in this Stored
Procedures?
---
Partial Public Class StoredProcedures1
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub GetTable()
Dim strSQL As String = "SELECT * FROM Table1"
Using conn As New SqlConnection("context connection=true")
Using cmd As New SqlCommand
With cmd
.Connection = conn
.CommandText = strSQL
.CommandType = CommandType.Text
conn.Open()
SqlContext.Pipe.ExecuteAndSend(cmd)
.Connection.Close()
End With
End Using
End Using
End Sub
End Class
---
Thanks!"James Wong" <cphk_msdn@.nospam.nospam> wrote in message
news:u155F84iGHA.1260@.TK2MSFTNGP05.phx.gbl...
> Hi,
> I am writing a vb.net2005 program that needs to create a stored procedure
> with SqlServerProject Template.
> Now, I have two questions for this stored procedure.
> 1) How can I import and execute the .dll in this Stored Procedures?
You need to deploy the assembly into your database (CREATE ASSEMBLY) and
then add a stored procedure referencing the method in the assembly (CREATE
PROCEDURE). Visual Studio will do this for you if you right-click on the
project and select Deploy.
Here's how you would do it by hand:
CREATE ASSEMBLY [SqlServerProject2]
FROM 'c:\SqlServerProject2.dll'
WITH PERMISSION_SET = SAFE
GO
CREATE PROCEDURE [GetTable]
AS
EXTERNAL NAME
[SqlServerProject2].[SqlServerProject2.StoredProcedures].[GetTable]
> 2) How can I connect the Web Service and get the result in this Stored
> Procedures?
>
From the web service just connect to the database and execute it with a
SqlCommand.
David|||Hi David,
sorry, i think that u were misunderstood my problem.
My Stored Procedure "StoredProcedures1.GetTable()" is need to call another
.dll & web service to get some value.
Thanks
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> glsD:O3xF9H5iGHA.45
04@.TK2MSFTNGP05.phx.gbl...
> "James Wong" <cphk_msdn@.nospam.nospam> wrote in message
> news:u155F84iGHA.1260@.TK2MSFTNGP05.phx.gbl...
> You need to deploy the assembly into your database (CREATE ASSEMBLY) and
> then add a stored procedure referencing the method in the assembly (CREATE
> PROCEDURE). Visual Studio will do this for you if you right-click on the
> project and select Deploy.
> Here's how you would do it by hand:
> CREATE ASSEMBLY [SqlServerProject2]
> FROM 'c:\SqlServerProject2.dll'
> WITH PERMISSION_SET = SAFE
> GO
> CREATE PROCEDURE [GetTable]
> AS
> EXTERNAL NAME
> [SqlServerProject2].[SqlServerProject2.StoredProcedures].[GetTable]
>
> From the web service just connect to the database and execute it with a
> SqlCommand.
> David
>|||"James Wong" <cphk_msdn@.nospam.nospam> wrote in message
news:eWXrxU5iGHA.412@.TK2MSFTNGP05.phx.gbl...
> Hi David,
> sorry, i think that u were misunderstood my problem.
> My Stored Procedure "StoredProcedures1.GetTable()" is need to call another
> .dll & web service to get some value.
>
To use another .dll add a reference to your database project. To use a web
service add a web reference.
David|||Hi David,
1) For DLL, VS.Net 2005 is not allow me to import a new References in
SqlServerProject Template.
2) For Web Service, it will occur error when running.
----
--
Partial Public Class StoredProcedures
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub SPWithWebService()
Dim WebService As New SqlServerProject1.localhost.Service
Dim msg As String = CStr(WebService.HelloWorld())
SqlContext.Pipe.Send(msg)
End Sub
End Class
----
--
Thanks
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> glsD:OqYxDh5iGHA.34
96@.TK2MSFTNGP04.phx.gbl...
> "James Wong" <cphk_msdn@.nospam.nospam> wrote in message
> news:eWXrxU5iGHA.412@.TK2MSFTNGP05.phx.gbl...
> To use another .dll add a reference to your database project. To use a
> web service add a web reference.
> David
>|||Hello James,
When you are using the VS SQL Server Project you are restricted to what
assemblies you can reference. This behavior is by design. However, you
could create a normal class library project, add references as per usual
and then manually create your assembly through CREATE ASSEMBLY. Make sure
your referenced
assemblies are in the same directory as your user assembly.
If you want to use the VS SQL Server Project you can create the assembly
you want to reference in the database before you try to reference it. You
need do a manual CREATE ASSEMBLY against the DLL you want.
As for Web service , you will also need to use the CLR SDK tool SGEN.EXE to
create and register a helper assembly for the assembly generated by WSDL,
as described in:
http://blogs.msdn.com/sqlclr/archiv.../25/Vineet.aspx
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
Sunday, February 19, 2012
Distributing Sql Express with Advanced Services
I'm writing an application that uses Sql Express 2005 with Advanced Services (for fulltext indexing) and will be needing to deploy the database server. I just realized that the install is 230+MB. Is there a way to trim this down to just the components/features I need?
Thanks,
Eric
hi Eric,
if you need FTX service, the Advanced Services package is the minimal deployment base... way igger then the "regular" SQLExpress package...
regards
Subscribe to:
Posts (Atom)