Showing posts with label apologies. Show all posts
Showing posts with label apologies. Show all posts

Sunday, March 25, 2012

ActiveX and SQL Server question?

Apologies for posting this in the wrong section, now pointed to here.

I have the following

AciveX script set up as a DTS package which I would like to alter so

that the output is sent to another server. :-

Function Main()
dim oCmd, sSql, oDom
set oDom = CreateObject("Msxml2.DOMDocument")
set oCmd = CreateObject("ADODB.Command")
oCmd.ActiveConnection = "Provider=SQLOLEDB; Data Source=MyServer; Initial Catalog=MyDB; Integrated Security=sspi"

sSql = "<ROOT

xmlns:sql='urn:schemas-microsoft-com:xml-sql'><sql:query>SELECT

* FROM VW_Projs1 FOR XML AUTO</sql:query></ROOT>"
oCmd.CommandText = sSql
oCmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"
oCmd.Properties("Output Stream") = oDom
oCmd.Execute, , 1024
oDom.Save "C:\Inetpub\wwwroot\test.xml"
Main = DTSTaskExecResult_Success
End Function

I want to schedule the package so it runs overnight, so
1.

Do I have to change the 'Integrated Security=sspi' part of the script

to reflect a user who has suitable rights to create/write a file on the

other server? If so How?
2. Would I redirect to the another

server/directory just by changing the path in oDom.Save to

"ServerName\DirectoryName".? or would there be a different format?

Thanks

I don't have much exp. in ActiveScript but I can say that if you are creating a flat file on a different server apart from the local server then you need to define the path correctly \\servername\path in order to create the file. Also ensure to check the SQLAgent permissions on the specified path as you're going to schedule this as a job.

Also you might try creating the file locally on the server and then copy the same using copy command in SQL scheduled job.

Thursday, February 16, 2012

Accessing SQL via http

Hello,
Apologies if this is in the wrong newsgroup...
I have followed the tutorial in Books Online that is called "Creating the
nwind Virtual Directory". Everything looks ok but I get an error that
says: -
"HTTP Error 404 - File or directory not found. Internet Information Services
(IIS) when I try to test it using http://<IISServer>/nwind?sql=SELECT * FROM
Employees FOR XML AUTO&root=root
I have looked all over trying to find out what I have done wrong :(
Is there anything else that needs to be set up?
Thanks in advance
Brian.Hi
You did change <IISServer> for the actual server name?
If all the properties look ok, then you may want to try restarting the web
server to see if that helps.
Make sure that you can ping the database server from the web server.
John
"Lost and Confused" <lostand@.nowhere.com> wrote in message
news:431f2057$0$30311$da0feed9@.news.zen.co.uk...
> Hello,
> Apologies if this is in the wrong newsgroup...
> I have followed the tutorial in Books Online that is called "Creating the
> nwind Virtual Directory". Everything looks ok but I get an error that
> says: -
> "HTTP Error 404 - File or directory not found. Internet Information
> Services
> (IIS) when I try to test it using http://<IISServer>/nwind?sql=SELECT *
> FROM
> Employees FOR XML AUTO&root=root
> I have looked all over trying to find out what I have done wrong :(
> Is there anything else that needs to be set up?
> Thanks in advance
> Brian.
>|||Hi John,
Yes, I amended "<IISServer>" to "myserv"
Excuse my ignorance but I'm not sure about restarting the web server. Do you
mean the 'World Wide Web Publishing Service' in 'Services'?
Thanks for replying
Brian.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:umSswh$sFHA.4076@.TK2MSFTNGP11.phx.gbl...
> Hi
> You did change <IISServer> for the actual server name?
> If all the properties look ok, then you may want to try restarting the web
> server to see if that helps.
> Make sure that you can ping the database server from the web server.
> John
> "Lost and Confused" <lostand@.nowhere.com> wrote in message
> news:431f2057$0$30311$da0feed9@.news.zen.co.uk...
>|||Sorry, I forgot to mention that I'm trying to set this up on our server.
The database is on 1 drive, the virtual directory has been set up and I'm
trying to retrieve the data using the same server.
So, no web hosting/external parties as everything is internal.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:umSswh$sFHA.4076@.TK2MSFTNGP11.phx.gbl...
> Hi
> You did change <IISServer> for the actual server name?
> If all the properties look ok, then you may want to try restarting the web
> server to see if that helps.
> Make sure that you can ping the database server from the web server.
> John
> "Lost and Confused" <lostand@.nowhere.com> wrote in message
> news:431f2057$0$30311$da0feed9@.news.zen.co.uk...
>|||Hi
That was the reboot/restart option! Could do stop/start IIS from Internet
Information Services on the Administrators menu.
If all directories/permissions exist and are correct, you may want to try
removing the directory and re-creating it. Check the IIS logs to see if
there is more information.
John
"Lost and Confused" <lostand@.nowhere.com> wrote in message
news:431f6810$0$3556$da0feed9@.news.zen.co.uk...
> Hi John,
> Yes, I amended "<IISServer>" to "myserv"
> Excuse my ignorance but I'm not sure about restarting the web server. Do
> you mean the 'World Wide Web Publishing Service' in 'Services'?
> Thanks for replying
> Brian.
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:umSswh$sFHA.4076@.TK2MSFTNGP11.phx.gbl...
>|||Hi John,
I had also posted the problem in the sqlserver.xml newsgroup. One suggestion
was to add a web service extension called SQLXML.
http://support.microsoft.com/defaul...4&Product=sql2k
This worked perfectly :
Thanks for your help
Brian.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:uZNNK2EtFHA.3236@.TK2MSFTNGP14.phx.gbl...
> Hi
> That was the reboot/restart option! Could do stop/start IIS from Internet
> Information Services on the Administrators menu.
> If all directories/permissions exist and are correct, you may want to try
> removing the directory and re-creating it. Check the IIS logs to see if
> there is more information.
> John
> "Lost and Confused" <lostand@.nowhere.com> wrote in message
> news:431f6810$0$3556$da0feed9@.news.zen.co.uk...
>|||Hi
Yes that is a pre-requisite!
John
"Lost and Confused" <lostand@.nowhere.com> wrote in message
news:431ffdb2$0$306$da0feed9@.news.zen.co.uk...
> Hi John,
> I had also posted the problem in the sqlserver.xml newsgroup. One
> suggestion was to add a web service extension called SQLXML.
> [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;810784&Product=sql2k[/ur
l]
> This worked perfectly :
> Thanks for your help
> Brian.
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:uZNNK2EtFHA.3236@.TK2MSFTNGP14.phx.gbl...
>

Accessing SQL via http

Hello,
Apologies if this is in the wrong newsgroup...
I have followed the tutorial in Books Online that is called "Creating the
nwind Virtual Directory". Everything looks ok but I get an error that
says: -
"HTTP Error 404 - File or directory not found. Internet Information Services
(IIS) when I try to test it using http://<IISServer>/nwind?sql=SELECT * FROM
Employees FOR XML AUTO&root=root
I have looked all over trying to find out what I have done wrong :(
Is there anything else that needs to be set up?
Thanks in advance
Brian.Could you please disable "Show friendly HTTP error messages" option in
Advanced tab of IE Options? This should give you more precise error
messages.
In the mean time, please ensure that you enable sql queries on the virtual
directory settings.
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lost and Confused" <lostand@.nowhere.com> wrote in message
news:431ef381$0$21190$db0fefd9@.news.zen.co.uk...
> Hello,
> Apologies if this is in the wrong newsgroup...
> I have followed the tutorial in Books Online that is called "Creating the
> nwind Virtual Directory". Everything looks ok but I get an error that
> says: -
> "HTTP Error 404 - File or directory not found. Internet Information
> Services (IIS) when I try to test it using
> http://<IISServer>/nwind?sql=SELECT * FROM Employees FOR XML
> AUTO&root=root
> I have looked all over trying to find out what I have done wrong :(
> Is there anything else that needs to be set up?
> Thanks in advance
> Brian.
>|||Hi,
Thanks for replying, I was beginning to despair ;)
I have disabled the friendly errors as you suggested but the 404 page still
doesn't show any more detail than before.
The sql queries were already enabled on the 'nwind
Properties/Settings/Options' tab
Do you have any other suggestions?
Thanks
Brian.
"Bertan ARI [MSFT]" <bertan@.online.microsoft.com> wrote in message
news:eTzZVB$sFHA.3604@.tk2msftngp13.phx.gbl...
> Could you please disable "Show friendly HTTP error messages" option in
> Advanced tab of IE Options? This should give you more precise error
> messages.
> In the mean time, please ensure that you enable sql queries on the virtual
> directory settings.
> --
> Bertan ARI
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Lost and Confused" <lostand@.nowhere.com> wrote in message
> news:431ef381$0$21190$db0fefd9@.news.zen.co.uk...
>|||I am sorry but that's all I could say. It is strange that you cannot see
more detailed error message instead of 404.
Can you access the web server for different directories and pages?
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lost and Confused" <lostand@.nowhere.com> wrote in message
news:431f5d05$0$17950$db0fefd9@.news.zen.co.uk...
> Hi,
> Thanks for replying, I was beginning to despair ;)
> I have disabled the friendly errors as you suggested but the 404 page
> still doesn't show any more detail than before.
> The sql queries were already enabled on the 'nwind
> Properties/Settings/Options' tab
> Do you have any other suggestions?
> Thanks
> Brian.
>
> "Bertan ARI [MSFT]" <bertan@.online.microsoft.com> wrote in message
> news:eTzZVB$sFHA.3604@.tk2msftngp13.phx.gbl...
>|||I just remember.
If you are using IIS6, you should enable some options on iis configuration
for security reasons:
http://support.microsoft.com/defaul...4&Product=sql2k
If this doesn't work, follow the steps given in this article:
http://sqlxml.org/faqs.aspx?79
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lost and Confused" <lostand@.nowhere.com> wrote in message
news:431f5d05$0$17950$db0fefd9@.news.zen.co.uk...
> Hi,
> Thanks for replying, I was beginning to despair ;)
> I have disabled the friendly errors as you suggested but the 404 page
> still doesn't show any more detail than before.
> The sql queries were already enabled on the 'nwind
> Properties/Settings/Options' tab
> Do you have any other suggestions?
> Thanks
> Brian.
>
> "Bertan ARI [MSFT]" <bertan@.online.microsoft.com> wrote in message
> news:eTzZVB$sFHA.3604@.tk2msftngp13.phx.gbl...
>|||Fantastic :)
I followed the first link and added the SQLXML web service extension, which
cured the problem.
I have now unchecked the 'Allow URL queries'
Thanks for your help
Brian.
"Bertan ARI [MSFT]" <bertan@.online.microsoft.com> wrote in message
news:uQxZ5AFtFHA.2792@.tk2msftngp13.phx.gbl...
>I just remember.
> If you are using IIS6, you should enable some options on iis configuration
> for security reasons:
> http://support.microsoft.com/defaul...rg/faqs.aspx?79
> --
> Bertan ARI
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Lost and Confused" <lostand@.nowhere.com> wrote in message
> news:431f5d05$0$17950$db0fefd9@.news.zen.co.uk...
>

Accessing SQL via http

Hello,
Apologies if this is in the wrong newsgroup...
I have followed the tutorial in Books Online that is called "Creating the
nwind Virtual Directory". Everything looks ok but I get an error that
says: -
"HTTP Error 404 - File or directory not found. Internet Information Services
(IIS) when I try to test it using http://<IISServer>/nwind?sql=SELECT * FROM
Employees FOR XML AUTO&root=root
I have looked all over trying to find out what I have done wrong
Is there anything else that needs to be set up?
Thanks in advance
Brian.
Could you please disable "Show friendly HTTP error messages" option in
Advanced tab of IE Options? This should give you more precise error
messages.
In the mean time, please ensure that you enable sql queries on the virtual
directory settings.
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lost and Confused" <lostandconfused@.nowhere.com> wrote in message
news:431ef381$0$21190$db0fefd9@.news.zen.co.uk...
> Hello,
> Apologies if this is in the wrong newsgroup...
> I have followed the tutorial in Books Online that is called "Creating the
> nwind Virtual Directory". Everything looks ok but I get an error that
> says: -
> "HTTP Error 404 - File or directory not found. Internet Information
> Services (IIS) when I try to test it using
> http://<IISServer>/nwind?sql=SELECT * FROM Employees FOR XML
> AUTO&root=root
> I have looked all over trying to find out what I have done wrong
> Is there anything else that needs to be set up?
> Thanks in advance
> Brian.
>
|||Hi,
Thanks for replying, I was beginning to despair ;)
I have disabled the friendly errors as you suggested but the 404 page still
doesn't show any more detail than before.
The sql queries were already enabled on the 'nwind
Properties/Settings/Options' tab
Do you have any other suggestions?
Thanks
Brian.
"Bertan ARI [MSFT]" <bertan@.online.microsoft.com> wrote in message
news:eTzZVB$sFHA.3604@.tk2msftngp13.phx.gbl...
> Could you please disable "Show friendly HTTP error messages" option in
> Advanced tab of IE Options? This should give you more precise error
> messages.
> In the mean time, please ensure that you enable sql queries on the virtual
> directory settings.
> --
> Bertan ARI
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Lost and Confused" <lostandconfused@.nowhere.com> wrote in message
> news:431ef381$0$21190$db0fefd9@.news.zen.co.uk...
>
|||I am sorry but that's all I could say. It is strange that you cannot see
more detailed error message instead of 404.
Can you access the web server for different directories and pages?
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lost and Confused" <lostandconfused@.nowhere.com> wrote in message
news:431f5d05$0$17950$db0fefd9@.news.zen.co.uk...
> Hi,
> Thanks for replying, I was beginning to despair ;)
> I have disabled the friendly errors as you suggested but the 404 page
> still doesn't show any more detail than before.
> The sql queries were already enabled on the 'nwind
> Properties/Settings/Options' tab
> Do you have any other suggestions?
> Thanks
> Brian.
>
> "Bertan ARI [MSFT]" <bertan@.online.microsoft.com> wrote in message
> news:eTzZVB$sFHA.3604@.tk2msftngp13.phx.gbl...
>
|||I just remember.
If you are using IIS6, you should enable some options on iis configuration
for security reasons:
http://support.microsoft.com/default...&Product=sql2k
If this doesn't work, follow the steps given in this article:
http://sqlxml.org/faqs.aspx?79
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lost and Confused" <lostandconfused@.nowhere.com> wrote in message
news:431f5d05$0$17950$db0fefd9@.news.zen.co.uk...
> Hi,
> Thanks for replying, I was beginning to despair ;)
> I have disabled the friendly errors as you suggested but the 404 page
> still doesn't show any more detail than before.
> The sql queries were already enabled on the 'nwind
> Properties/Settings/Options' tab
> Do you have any other suggestions?
> Thanks
> Brian.
>
> "Bertan ARI [MSFT]" <bertan@.online.microsoft.com> wrote in message
> news:eTzZVB$sFHA.3604@.tk2msftngp13.phx.gbl...
>
|||Fantastic
I followed the first link and added the SQLXML web service extension, which
cured the problem.
I have now unchecked the 'Allow URL queries'
Thanks for your help
Brian.
"Bertan ARI [MSFT]" <bertan@.online.microsoft.com> wrote in message
news:uQxZ5AFtFHA.2792@.tk2msftngp13.phx.gbl...
>I just remember.
> If you are using IIS6, you should enable some options on iis configuration
> for security reasons:
> http://support.microsoft.com/default...&Product=sql2k
> If this doesn't work, follow the steps given in this article:
> http://sqlxml.org/faqs.aspx?79
> --
> Bertan ARI
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Lost and Confused" <lostandconfused@.nowhere.com> wrote in message
> news:431f5d05$0$17950$db0fefd9@.news.zen.co.uk...
>

Monday, February 13, 2012

Accessing reportviewer from web

Hi,
apologies for what I know is a very basic question. We have a very simple ASP.NET page that includes a report viewer object. The site containing the page is on a public server, and the report server is on an internal server (actually the same physical machine, but running on a different IP) - we are referencing the report server via a 10.x.x.x address and it's not connecting from outside. The report server is not accessible from the public address, and I don't believe there's firewall issues - can someone please point me in the right direction?

thanks,
Steve.

<snip>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Security;

namespace WebReportTest2
{
/// <summary>
/// Summary description for WebForm2.
/// </summary>
public class WebForm2 : System.Web.UI.Page
{
protected System.Web.UI.HtmlControls.HtmlForm Form1;
protected System.Web.UI.WebControls.DropDownList DropDownList1;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.DropDownList Dropdownlist2;
protected System.Web.UI.HtmlControls.HtmlForm Form2;
protected System.Web.UI.WebControls.DropDownList Dropdownlist3;
protected System.Web.UI.WebControls.Button btnLogOut;
protected Microsoft.Samples.ReportingServices.ReportViewer ReportViewer1;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
//this.DropDownList1.Items.Add(new ListItem("report1,"report1"));

string param = DropDownList1.SelectedValue;
ReportViewer1.ReportPath = "/Development/report1" + param ;
ReportViewer1.ServerUrl = "http://10.72.x.x/reportserver";

}
If you log onto the console of the web server are you able to access the report server using the 10.x.x.x address? My guess would be that it is an IP/subnet issue, but I'm not really an expert in that area.|||Yep, it's actually the same server but sites running on different addresses. It looks to me like the reportviewer object is being created on the client side, and therefore can't resolve the internal 10.x.x.x address. It's not my code, and I'm no ASP.NET guru, but the object seems to be created in the ASPX page correctly, with "runat=server", but is then also created in a C# code behind page, and it's this object that's actually being created, and it's client, not server side...if all that makes sense...

cheers,
STeve.
|||

I have not done that much with the report viewer in ASP.NET, most of my experience with this control has been with the Windows Forms edition. But my understanding with the ASP.NET version was that most of the rendering takes place on the server side.

One thing thing you could checked is the permissions. If you are running the ASP.NET app from a public server I assume that you are running the standard impersonation mode which would mean that the account accessing the report server would either be the ASPNET account if you are running IIS 5 or the account that is configured for the app pool if you are running IIS 6. The account in question would need to have permission to access the report server and run the report(s) in question.

Thursday, February 9, 2012

Accessing one database from multiple SQL servers

Apologies if this question has been asked before. I am about to upgrade a multiuser application based on Access97 and VB6 to C# and possibly SQL Server Express.

My customer does not want to use a server based database solution ie a single instance of SQL Server, but prefers to have a common networked dataset which is accessed via user's own individual database engines. This is because of restrictions on the installation of server based apps.

Does this scenario completely rule out the use of SQL Server Express?

Thanks

You can use SQL Server Express installed on each machine (it's pretty lightweight) with no problem, and even set up a replication between them if they need to share data. A better bet might be to use SQL Server Compact Edition, which is "embeddable". See here for more info:

http://www.microsoft.com/sql/editions/compact/default.mspx

Buck

|||Thanks. I 'll take a look at that.