Showing posts with label connected. Show all posts
Showing posts with label connected. Show all posts

Sunday, March 25, 2012

Connectivity to excel from a different domain

Hi,

I would like to know if anybody has successfully connected to Analysis services cube using Excel 2007 over a different domain using the msmdpump ? I am able to connect it over the intranet, but if I try to connect from any other outside environment it fails to connect .

My analysis server and IIS are configured on the same box.

Any suggestions most welcome.

Thanks

JK

I have no problem with connecting over HTTP to the server in another domain. For example, DSP Panel runs open server in Internet - I just connected to it from Excel - just put the following in the wizard: http://demo.dspanel.com/olap/msmdpump.dll

HTH,

Mosha (http://www.mosha.com/msolap)

|||

This sounds like a firewall/routing problem. Might be worth trying to get some networking admin to help out.

In the meantime, can you connect to the IIS server for normal content?

sqlsql

Thursday, March 22, 2012

ConnectionString property has not been initialized

My IT dept set up an SQL db on a server for me and I am connected to it through a port. They told me I had to create my tables through an MS Access adp, which I have done. I am using VWD Express and am trying to create a login page using usernames and pw's from a db table. I am connected (at least the db Explorer tab shows I am) to the MS Access adp and can drop a GridView from my Employees table from it onto a page and get results. I keep getting the "ConnectionString property not initialized" error message pointing to my sqlConn.Open() statement and cannot figure out why. I have looked at hundreds of posts but can't seem to find anything that works. If someone could point me to some post or website that could explain connecting to a SQL db through a port or whatever you think I need to learn to get this fixed I would appreciate it.
Web config:

<configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<appSettings/>

<connectionStrings>

<addname="ASPNETDB"connectionString="Description=Training;DRIVER=SQL Server;SERVER=USAWVAS27;UID=usx14611;APP=Microsoft? Visual Studio? 2005;WSID=983QD21;Network=DBMSSOCN;Address=USAWVAS27,3180;Trusted_Connection=Yes"providerName="System.Data.Odbc"/>

</connectionStrings>

<system.web>

<authenticationmode="Forms" />

<authorization>

<denyusers="?" />

</authorization>

<customErrorsmode="Off" />

</system.web>

</configuration>
My login.aspx page

<%@.PageLanguage="VB"debug="true"%>

<%@.ImportNamespace="System.Data.SqlClient" %>

<%@.ImportNamespace="System.Configuration.ConfigurationManager" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<scriptrunat="server">

ProtectedSub LoginUser(ByVal sAsObject,ByVal eAs EventArgs)

Dim blnAuthenticateAsBoolean = Authenticate(username.Text, password.Text)

If blnAuthenticateThen

FormsAuthentication.RedirectFromLoginPage(username.Text,False)

EndIf

EndSub

Function Authenticate(ByVal strUsernameAsString,ByVal strPasswordAsString)AsBoolean

Dim strConnectionAsString = ConfigurationManager.AppSettings("ASPNETDB")

Tried this code as well
Dim sqlConn As New SqlConnection(ConfigurationManager.AppSettings("ASPNETDB"))

Dim sqlConnAsNew SqlConnection(strConnection)

Dim sqlCmdAs SqlCommand

Dim sqlDRAs SqlDataReader

Dim userFoundAsBoolean

sqlCmd =New SqlCommand("SELECT * FROM Employees " & _

"WHERE username='" & strUsername &" ' AND password='" & strPassword &"'", sqlConn)

sqlConn.Open()

sqlDR = sqlCmd.ExecuteReader()

userFound = sqlDR.Read()

sqlDR.Close()

Return userFound

EndFunction

</script>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<div>

<p>Username:<asp:TextBoxID="username"runat="server"></asp:TextBox><br/>

<br/>

<p>Password:<asp:TextBoxID="password"runat="server"></asp:TextBox><br/>


<br/>

<asp:ButtonID="btnSubmit"runat="server"Text="Login"OnClick="LoginUser"/> </div>

</form>

</body>

</html>
Thanks

Still trying to figure this out. I can't believe that there isn't some resource(book, website..) out their that explains these types of errors. My IT dept insists that the database was set up correctly to allow me to use a table with usernames and pw's to build a login page but no matter what I try I get the same message. There doesn't seem to be any reason whatsoever for it to not work. I'm not even getting errors when I debug, just when I enter a login/password onto my login.aspx page and submit.
I removed my database connection and reconnected which gave me this as a new connection string:

<connectionStrings>

<addname="connString"connectionString="Data Source=USAWVAS27;Initial Catalog=MaterialsTraining;Integrated Security=False"/>

</connectionStrings>
Anybody have any ideas?
Thanks,
Toni

|||I haven't done this in VB, but here's what I think it should be based on how C# does it.
Looks like this:

Dim strConnectionAsString = ConfigurationManager.AppSettings("ASPNETDB")

Should be this:

Dim strConnectionAsString = ConfigurationManager.ConnectionStrings("ASPNETDB").ConnectionString

|||

Finally got this figured out so thought I'd share it. Thanks to those who responded with suggestions. It didn't like "DRIVER" and "Description" in my original system generated connection string, I'm assuming because it is an SQL database (?)
<connectionStrings>

<addname="ASPNETDB"connectionString="DataSource=Training;server=USAWVAS27;wsid=983QD21;network=DBMSSOCN;address=USAWVAS27,3180;trusted_connection=Yes"/>

</connectionStrings>

|||Hello, am getting a similar problem to the one you had. But I stilldon't know how to fix it. I only get the error when am runnign thelogin.It says the conn is not initialized. It's been giving me aheadache for 2 days now. Please help if possible
Protected Sub loginBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles loginBtn.Click
Dim strConnection As String = ConfigurationManager.AppSettings("sups")
Dim conn As New SqlConnection(strConnection)
Dim cmd As SqlCommand
Dim read As SqlDataReader
conn.Open()
The web.config file is like this...
<configuration>
<appSettings/>
<connectionStrings>
<add name="sups"connectionString="server=localhost;Trusted_Connection=true;database=sups;uid=abcd; pwd=abcd;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
Where am I going wrong? Thanks a lot
|||I fixed this error with this if anyone is having problems

Dim sSQL As String
sSQL = "SELECT * FROM optionitems WHERE id=" & ID.ToString


Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("cre8StoreConnectionString").ConnectionString)
Dim cmd As New SqlCommand(sSQL)
conn.Open()
cmd.Connection = conn

Dim reader As SqlDataReader = cmd.ExecuteReader

the problem I was having to genrate this error was caused because I was using the datareader without assigning a connection to the SQLcommand object.

Sunday, March 11, 2012

Connection to the SSAS Cubes

I have some users connecting to the cubes using excel, is there any way i can track which users aere connected to the cubes without using the Profiler/running a trace.

You can do an XMLA discover command to discover the current sessions/connections

<Discover xmlns="urnTongue Tiedchemas-microsoft-com:xml-analysis">

<RequestType>DISCOVER_SESSIONS</RequestType>

<Restrictions>

<RestrictionList />

</Restrictions>

<Properties>

<PropertyList />

</Properties>

</Discover>

<Discover xmlns="urnTongue Tiedchemas-microsoft-com:xml-analysis">

<RequestType>DISCOVER_CONNECTIONS</RequestType>

<Restrictions>

<RestrictionList />

</Restrictions>

<Properties>

<PropertyList />

</Properties>

</Discover>

But I think that the easiest way to run these commands is to use the Analysis Services Stored Procedure Project www.codeplex.com/asstoredprocedures where you can do the equivalent and get the results in an easy to read table form by doing

CALL ASSP.DiscoverSessions();

or

CALL ASSP.DiscoverConnections();

There was also an AMO Activity sample (or something like that) in the Analysis Services product samples that could show this sort of information.

Thursday, March 8, 2012

Connection to SQL Server 2000 with PB 6.5

Currently I am using PB 6.5 with MS SQL Server 6.5. Would it work if it is
connected to SQL Server 2000? Please advice me. Thank you.Is PB PowerBuilder?
Generally speaking, sure a 6.5 app should be able to connect to a SQL Server
2000 machine. Honestly, I've never done it. However, there are differences
between 6.5 and 2000 that could cause your queries to behave differently.
You might want to think about testing under a 6.5 compatibility mode.
--
Brian
"Tony" <Tony@.discussions.microsoft.com> wrote in message
news:8C783B6C-7717-4876-8EB3-4EC06E01E595@.microsoft.com...
> Currently I am using PB 6.5 with MS SQL Server 6.5. Would it work if it is
> connected to SQL Server 2000? Please advice me. Thank you.
>|||Yes Brian, PB is PowerBuilder. Thank you for your information.
"Tony" wrote:
> Currently I am using PB 6.5 with MS SQL Server 6.5. Would it work if it is
> connected to SQL Server 2000? Please advice me. Thank you.
>

Saturday, February 25, 2012

Connection Timeout

Is there any configuration option that controls how long
a user stays connected to mssql server? I have an
application that logs into mssql server and then uses
that one login for all work never logging out, after
about 7 days(fairly consistently) the connection to the
mssql gets killed and the application has to be
restarted. I was just curious if there is some kind of
parameter within mssql server that kills logins after x
number of days?
Thanks,
CarlHi,
There is no parameter in SQL server which will kill the user after x number
of days.
Rather you can write ur own code based on the login_time in
master..sysprocesses table and compare with getdate() for each process id
available in the list.
If any of the SPID is older then x days you can use
KILL SPID to kill the user. SPID also you can take it from
master..sysprocesses tables
Thanks
Hari
MCDBA
"z-man" <anonymous@.discussions.microsoft.com> wrote in message
news:817d01c4076d$e655aa20$a601280a@.phx.gbl...
> Is there any configuration option that controls how long
> a user stays connected to mssql server? I have an
> application that logs into mssql server and then uses
> that one login for all work never logging out, after
> about 7 days(fairly consistently) the connection to the
> mssql gets killed and the application has to be
> restarted. I was just curious if there is some kind of
> parameter within mssql server that kills logins after x
> number of days?
> Thanks,
> Carl
>|||There isn't anything like that built into SQL Server. You
could write your own procedure to do something like that but
nothing built into SQL Server.
If the application is on PC, server other than SQL Server,
you may want to look into network connectivity issues. You
may want to check the event logs where the application is
and see if you can find any clues in the logs.
-Sue
On Thu, 11 Mar 2004 05:36:47 -0800, "z-man"
<anonymous@.discussions.microsoft.com> wrote:

>Is there any configuration option that controls how long
>a user stays connected to mssql server? I have an
>application that logs into mssql server and then uses
>that one login for all work never logging out, after
>about 7 days(fairly consistently) the connection to the
>mssql gets killed and the application has to be
>restarted. I was just curious if there is some kind of
>parameter within mssql server that kills logins after x
>number of days?
>Thanks,
>Carl|||There is a 2 hour tcp session timeout and 1 hour for name pipe sessions.
But, this is controlled by the OS, not SQL.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||That's a good point...and looking at the keepalive settings
could be an option. After thinking about it more and that if
this happens about every 7 days, it may more likely be
related to a weekly process or something similar that is
hosing the connection. I think I'd go through the logs and
look for activity around the time the connection gets hosed.
-Sue
On Thu, 11 Mar 2004 21:02:41 GMT, kevmc@.online.microsoft.com
(Kevin McDonnell [MSFT]) wrote:

>There is a 2 hour tcp session timeout and 1 hour for name pipe sessions.
>But, this is controlled by the OS, not SQL.
>Thanks,
>Kevin McDonnell
>Microsoft Corporation
>This posting is provided AS IS with no warranties, and confers no rights.
>

Connection switching to "sa" login

I have seen some strange behaviour where a connection flips from the login it connected with to use "sa".

I have evidence of this captured in a .trc file, where you can see a particular SPID being used (via Management Studio) under a windows login, then for some reason the login name changes to "sa" for a couple of queries, then changes back to the windows login.

Has anyone else noticed behaviour like this? It's starting to cause me real hassle as it shows up on our Audit reports, when we're only supposed to use "sa" in emergencies only.

Could you please file a defect report for this on the Connect site (http://connect.microsoft.com/sqlserver)? Defects reported by customers on the Connect site go directly into our internal defect tracking system so we don't lose any information. Also, customer reported issues have additional weight with the development team when we are prioritizing future work.

If possible, try to come up with a compact set up steps that illustrate the issue on a sample database such as AdventureWorks or Northwind. That will make it much easier for us to figure out what is going on. Attaching a .trc file might help as well if the problem queries are coming from a dialog or other UI (other than the query editor).

Thanks,
Steve

|||

Have you disabled SA account on your server?

What are privileges for the SQL Server services account?

Connection string with sa password

My application designed with VB6.0 is connected to MS SQL Server 7.0.
Server has password for sa login. The VB code for connection is next:
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.ConnectionTimeout = 30
Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial Catalog=master;Data
Source=server;Password=mypassword;
Conn.Open
Connection performs successfully but after that Conn.ConnectionStrring
value has changed and equals
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
Data=False;Tag with column collation when possible=False
There is no any information about sa password which is not blank.
Connection object Conn is a global object in my application which is
used after, so I get a error
Login failed for user sa
How can I save my sa password in connection string?First of all, you shouldn't be using 'sa' to connect to SQL Server, from
your applications. This is a security threat, as 'sa' happens to be a
powerful login.
Then, you should be either using a DSN, or store your connection string
somewhere (Global.asa may be?), so that it is there at a specific location,
and that it never changes.
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Vadim Bulat" <bulat@.asuxxivek.spb.ru> wrote in message
news:7e1d1f98.0407150731.78249213@.posting.google.com...
> My application designed with VB6.0 is connected to MS SQL Server 7.0.
> Server has password for sa login. The VB code for connection is next:
> Dim Conn As ADODB.Connection
> Set Conn = New ADODB.Connection
> Conn.ConnectionTimeout = 30
> Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=sa;Initial Catalog=master;Data
> Source=server;Password=mypassword;
> Conn.Open
> Connection performs successfully but after that Conn.ConnectionStrring
> value has changed and equals
> Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
> Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
> Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
> Data=False;Tag with column collation when possible=False
> There is no any information about sa password which is not blank.
> Connection object Conn is a global object in my application which is
> used after, so I get a error
> Login failed for user sa
> How can I save my sa password in connection string?

Connection string with sa password

My application designed with VB6.0 is connected to MS SQL Server 7.0.
Server has password for sa login. The VB code for connection is next:
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.ConnectionTimeout = 30
Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial Catalog=master;Data
Source=server;Password=mypassword;
Conn.Open
Connection performs successfully but after that Conn.ConnectionStrring
value has changed and equals
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
Data=False;Tag with column collation when possible=False
There is no any information about sa password which is not blank.
Connection object Conn is a global object in my application which is
used after, so I get a error
Login failed for user sa
How can I save my sa password in connection string?
First of all, you shouldn't be using 'sa' to connect to SQL Server, from
your applications. This is a security threat, as 'sa' happens to be a
powerful login.
Then, you should be either using a DSN, or store your connection string
somewhere (Global.asa may be?), so that it is there at a specific location,
and that it never changes.
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Vadim Bulat" <bulat@.asuxxivek.spb.ru> wrote in message
news:7e1d1f98.0407150731.78249213@.posting.google.c om...
> My application designed with VB6.0 is connected to MS SQL Server 7.0.
> Server has password for sa login. The VB code for connection is next:
> Dim Conn As ADODB.Connection
> Set Conn = New ADODB.Connection
> Conn.ConnectionTimeout = 30
> Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=sa;Initial Catalog=master;Data
> Source=server;Password=mypassword;
> Conn.Open
> Connection performs successfully but after that Conn.ConnectionStrring
> value has changed and equals
> Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
> Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
> Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
> Data=False;Tag with column collation when possible=False
> There is no any information about sa password which is not blank.
> Connection object Conn is a global object in my application which is
> used after, so I get a error
> Login failed for user sa
> How can I save my sa password in connection string?

Sunday, February 19, 2012

Connection string for Remote Database connectivity(SQL Server2000)

hai,

I am working on ASP.NET 2003 with SQLServer2000. My application requires to be connected to the Database which is there in my Headoffice.

My SQLServerName is "MyDBServer\TestDB"

Database Name is "WebTO", UserID="******" and Password="******"

My Remote Server IP Address is "192.168.1.2" and its Static IP is "58.93.61.235"

I have specified the Connection string for my Remote Server as

"Provider=SQLOLEDB.1;Server=58.93.61.235\TestDB;UID=******;PWD=******;Database=WebTO"

(or)

"Provider=SQLOLEDB.1;Server=58.93.61.235\TestDB,1433;UID=******;PWD=******;Database=WebTO" (1433 is the Port number of the Remote SQLServer)

but it is giving the error " SQL Server does not exist or access denied".

if i execute the same application at my Headoffice (Remote Server) by changing the Connection string as

"Provider=SQLOLEDB.1;Server=192.168.1.2\TestDB;UID=******;PWD=******;Database=WebTO"

then, it is working fine.

Can anyone tell me where i went wrong or what i have to specify in my Connection string so that i can access my Remote Database Server.

Thanks in Advance,

Srinivas.

try

server=192.168.1.2,1433 ................... hope it will work

|||

192.168.1.2,1433 is also not working.

But, i don't know how can we access the Remote Server just by giving the IP without giving it's static IP.

|||

did u try with the static ip

58.93.61.235,1433

|||

My friend it seems that u aren't aware of my previos post where i have clearly mentioned that i have already tested with Static IP, 58.93.61.235,1433 but it is giving the error "SQL Server doesn't exist or access denied".

|||

Hi Srinivas,

have you enabled remote connections on your sql server? one more thing why are you specifying provider=SQLOLEDB?

do take a look at this link >>>>http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_22604523.html, under the threadhttp://forums.asp.net/t/1118398.aspx

migth be helpful to you

thanks,

satish.

|||

Hi Satish,

Thanks for ur reply.

Remote Connections on my SQL Server option is already in Enabled state. ( "Allow other SQL Servers to connect remotely to this SQL Server using RPC" check box is already in Checked state.)

And Regarding Provider=SQLOLEDB, when i am using OLEDB object, i need to provide the Provider information right?

And the link which u had given is asking to get registered in that site which is not a Free site.

Thank you.

Srinivas.

|||

Hi,

The IP (192.168...) works because you are in LAN. Each machine can be connected with each other and the IP of the remote machine is setting to "192.168..." (You can useipconfig -all to check it in command prompt.) You can't use Query Analyzer to connect the romote database by your static IP neither. So, just assign your machine with your static IP and have a try.

Thanks.

Sunday, February 12, 2012

connection problems to a SQL2005 DB that I own

I am a DB owner/ creator. I have connected to the DB before through my ASP.net app in the server explorer. Now when I try to refresh the connection I get an error message that says "User does not have permission to perform this action." I cannot figure out why because my connection string has not changed and my DB is still in the same location as it was before. I have checked all of the permissions on the SQL Server management studio and I have permissions to do everything. PLEASE HELP! :(

This has nothing to do with connection string ...

You must check the priviliges granted to the user from which you have logged into your data base.

|||

tabish82:

This has nothing to do with connection string ...

You must check the priviliges granted to the user from which you have logged into your data base.

As I said in the above post...

"I have checked all of the permissions on the SQL Server management studio and I have permissions to do everything"

I have not changed any of the permissions or used a different log on to access the db. I still cannot get connected.

|||

Check out:

http://blogs.msdn.com/kaelr/archive/2005/10/28/486369.aspx

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=648224&SiteID=1

Hope it helps...

|||

There might be some changes in the network configuration (e.g. Firewall).

Try to disable your firewall on Windows and try again.

Good luck.

|||

I have all firewall settings disabled, but thanks anyway

|||

Can you register (or connect to) your database server using same UserID and Password?

|||

Do you have a linked server?

I hope this will help:

http://blogs.msdn.com/kaelr/archive/2005/10/28/486369.aspx

http://www.aspspider.com/qa/ViewQuestion.aspx?QuestionId=1032

Good luck.

Connection problems

Am working on a SQL Server 2000 db with Powerbuilder 8 as the frontend. For
months our endusers connected thru the SQL Server native driver for version
6. Now, have just ported the application to Powerbuilder 10, and I
understand that the native drivers for SQL Server 2000 no longer exist in
Powerbuilder, and you are expected to use OLEDB or ODBC. Thinking that
OLEDB was the preferred method, I attempted to connect to the Server with
this Profile in Powerbuilder. I could connect fine, but it frooze everyone
else out. Anyone else have this problem, and if, how did you resolve it?
So, some more questions:
1). What is the preferred way to connect to SQL Server 2000, OLEDB or ODBC.
2). What is the fastest connection?William F. O'Neill (wfoneill@.bellsouth.net) writes:
> Am working on a SQL Server 2000 db with Powerbuilder 8 as the frontend.
> For months our endusers connected thru the SQL Server native driver for
> version 6. Now, have just ported the application to Powerbuilder 10,
> and I understand that the native drivers for SQL Server 2000 no longer
> exist in Powerbuilder, and you are expected to use OLEDB or ODBC.

I suppose that what you call "native drivers" is the old DB-Library
API, that I know that older versions of Powerbuilder used. MS has
deprecated this API, and have not made any development to it since
1998, so with DB-Lib you lack support for a lot of new stuff. All reason
to change.

> Thinking that OLEDB was the preferred method, I attempted to connect to
> the Server with this Profile in Powerbuilder. I could connect fine, but
> it frooze everyone else out. Anyone else have this problem, and if, how
> did you resolve it? So, some more questions:
> 1). What is the preferred way to connect to SQL Server 2000, OLEDB or
> ODBC.
> 2). What is the fastest connection?

It's not that OLE DB locks up the database by its own. There must be
something to it, but with zero knowledge of your environment, I have no
clue what it might be.

My prime choice would be SQLOLEDB to connect. But I need to add the
disclaimer that I have no experience of Powerbuilder, and it depends a
little on the API that Powerbuilder gives you. What you should not
use is OLE DB over ODBC, but make sure that you have Provider=SQLOLEDB
in your connectstring.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp