Tuesday, March 27, 2012
Consistent Formatting
available, how can I pick from this same list when I create a report with
the wizard?
How can I easily apply the same color theme to multiple reports?
TIA
DeanOn Jun 13, 2:34 pm, "Dean" <deanl...@.hotmail.com.nospam> wrote:
> If I create are report using a wizard, there are some color choices
> available, how can I pick from this same list when I create a report with
> the wizard?
> How can I easily apply the same color theme to multiple reports?
> TIA
> Dean
One option would be to physically copy the report and then modify the
controls, parameters, datasets, etc in it. Something else worth
looking into is if you can tie a report to a style sheet (css). This
option I don't have experience w/but is worth a shot. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultantsqlsql
Sunday, March 25, 2012
Connot create default directory?
I went ahead and installed RS even though it was clear Microsoft install was confused (re: preivous post). Now I get to experience the thrill of configuration hell.
Report Server Virtual Directory had a green check. Unfortunately the Name block says <Not Set>. When I try to create a New... default directory I get the error message: "The virtual directory could not be created. The previously set virtual directory will still be used."
Does anyone know where the <Not Set> virtual directory is stored on the computer?
addl info:
ReportServicesConfigUI.WMIProvider.WMIProviderException: The virtual directory specified already exists. Specify a different name.
at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.CreateVirtualDirectory(String virtualDirectory, String path)
(Vista Ultimate)
AND when I try to browse to the default directory it did let me create (ReportServerDir), of course I get 404.0 error - Not Found
Connector between executables dissapears
Dear Forum Members.
I am currently using Visual Studio 2005: Business Intelligence Development Studio to create an Integration Services Package.
The package contains several containers, within each container there is a ‘foreach loop container’ and within the ‘foreach loop container’ there is a script component, execute component and another script component.
Each of the three components is connected together by single connectors.
My issue arises when I disable a container and then enable the container; the connectors between the components disappear (e.g. are not visible) but do exist as I can not create another connector between the components. When I attempt to create the connector again between the components I receive the error message. This tells me the connectors are present but not visible.
TITLE: Microsoft Visual Studio
Cannot create connector.
Only one workflow can exist between the same two executables.
BUTTONS:
OK
Can someone kindly explain why this is happening and how to resolve this issue?
I can not change the connector types from success to completion or vice versa because the connectors are not visible for me to select them.
Many Thanks
I have had this happen quite frequently. The only solution I found was to exit and restart BIDS.|||
Dave
Thanks very much for your response. The resolution works.
Regards
sqlsqlConnectivity Problems
I could nt create a Sql Server ODBC with Norton autoprotect ON
when i disable Norton Autoprotect, the DSN Creation is successful.
why is this so?Originally posted by baburajv
hi
I could nt create a Sql Server ODBC with Norton autoprotect ON
when i disable Norton Autoprotect, the DSN Creation is successful.
why is this so?
Hi,
Some sort of antiviruses do not allow to connect/ creates problem in connectivity that is very comman problem by them..
try to install same version of antivirus on client pc, then try
hope this will work.
Connectivity Issues in AMO
Hi,
I am using AMO to connect to SSAS 2005 and programmatically create objects. currently I am specifying only the ServerName in the connection string. Please see the code below:
<code>
Server SSASServer = new Microsoft.AnalysisServices.Server();
SSASServer.Connect("DataSource=" + ServerName);
</code>
The above code works fine and I am able to connect. Now I want to provide the instance name of the server and also the server name. because tomorrow we will have multiple instances of Analysis server running on the same server. I read somewhere that we need to specify ServerName\InstanceName.
SSASServer.Connect(ServerName + "\\" + InstanceName);
So I tried the above, with both the serverName and InstanceName being the same for now. (currently only one instance is running). but that is not working, whenever I do that I get the error: I also removed the string "DataSoruce=", still I get the same error.
{"A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running."}
1. How to identify the ServerName and the InstanceName?
2. How to specify them in the connection string?
3. Currently I am using Windows Integrated Authentication, how do i specify username and password to connect to SSAS 2005.
Please do provide any information possible.
Thanks and Regards
Vijay R
Connection to the default instance could only be made by using ServerName.
Anything you specify after the '\' will be considered as an instance name. meaning client will try to find an AS named instance with such name.
In your experiment above, it will try to find a named instance and will fail because you dont have it installed.
Get your named instance installed and connect to it using ServerName\InstanceName where InstanceName you provide during setup of Analysis Server.
Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi,
Thanks a lot Melomed,
That certainly helped me.
But what about specfying the Username and password for connection.
That is if I do not want to use Windows Integrated Authentication for SSAS in AMO.
Regards
Vijay R
|||
When using TCP/IP to connect to Analysis Server , Windows authentication is your only choice.
Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi Melomed,
I was succesful in implementing and executing teh AMO based app that creates Cubes, Dimensions, MeasureGroups, Measures and Partitions.
but I still have the problem of connecting to an named instance of the SSAS server. I now have a named instance of SSAS.
I am also able to conect to it using the BI studio /Visual Studio 2005. After connecting the summary/properties display ServerName\InstanceName.
but when i try this programmatically using AMO, it throws the below error. (the same one!)
{"A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running."}
Here is the code:
string tempConnstring = "DataSource=" + SSASServerName + @."\" + SSASInstanceName;
SSASServer.Connect(tempConnstring);
-
Please do help me as to how I should be doing this?
Thanks and Regards
Vijay R
|||It is not "DataSource="
But rather "Data Source="
You are missing a space there.
Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Thursday, March 22, 2012
Connectivity across Domains.
something different from a normal linked server ?
Thanks
Si
Hi
Unless you have a trust relationship between the 2 domains, you need to use
a SQL Server login for the linked server.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:89D3E5FE-EA5E-458F-B0FB-F91E1E8467D9@.microsoft.com...
> Can you create linked SQL servers across domains ? If so do you need to do
> something different from a normal linked server ?
> Thanks
> Si
|||The two domains do not trust each other and the Network guys have no
intention of changing this. However when i try and link the server with
username and password I still can`t connect to run a query on the linked
server.
Si
"Mike Epprecht (SQL MVP)" wrote:
> Hi
> Unless you have a trust relationship between the 2 domains, you need to use
> a SQL Server login for the linked server.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Simon" <Simon@.discussions.microsoft.com> wrote in message
> news:89D3E5FE-EA5E-458F-B0FB-F91E1E8467D9@.microsoft.com...
>
>
|||Make sure the request is going over TCP rather than named pipes. The latter
tries to enforce a network login even though you're using SQL
authentication.
Cheers,
'(' Jeff A. Stucker
\
Senior Consultant
www.rapidigm.com
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:D01D0AB4-7741-4BE2-8DEF-A24AA303F1B7@.microsoft.com...[vbcol=seagreen]
> The two domains do not trust each other and the Network guys have no
> intention of changing this. However when i try and link the server with
> username and password I still can`t connect to run a query on the linked
> server.
> Si
> "Mike Epprecht (SQL MVP)" wrote:
|||And use an IP address for the server name.
-Sue
On Tue, 13 Dec 2005 05:17:07 -0800, "Simon"
<Simon@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>The two domains do not trust each other and the Network guys have no
>intention of changing this. However when i try and link the server with
>username and password I still can`t connect to run a query on the linked
>server.
>Si
>"Mike Epprecht (SQL MVP)" wrote:
Connectivity across Domains.
something different from a normal linked server ?
Thanks
SiHi
Unless you have a trust relationship between the 2 domains, you need to use
a SQL Server login for the linked server.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:89D3E5FE-EA5E-458F-B0FB-F91E1E8467D9@.microsoft.com...
> Can you create linked SQL servers across domains ? If so do you need to do
> something different from a normal linked server ?
> Thanks
> Si|||The two domains do not trust each other and the Network guys have no
intention of changing this. However when i try and link the server with
username and password I still can`t connect to run a query on the linked
server.
Si
"Mike Epprecht (SQL MVP)" wrote:
> Hi
> Unless you have a trust relationship between the 2 domains, you need to us
e
> a SQL Server login for the linked server.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Simon" <Simon@.discussions.microsoft.com> wrote in message
> news:89D3E5FE-EA5E-458F-B0FB-F91E1E8467D9@.microsoft.com...
>
>|||Make sure the request is going over TCP rather than named pipes. The latter
tries to enforce a network login even though you're using SQL
authentication.
Cheers,
'(' Jeff A. Stucker
\
Senior Consultant
www.rapidigm.com
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:D01D0AB4-7741-4BE2-8DEF-A24AA303F1B7@.microsoft.com...[vbcol=seagreen]
> The two domains do not trust each other and the Network guys have no
> intention of changing this. However when i try and link the server with
> username and password I still can`t connect to run a query on the linked
> server.
> Si
> "Mike Epprecht (SQL MVP)" wrote:
>|||And use an IP address for the server name.
-Sue
On Tue, 13 Dec 2005 05:17:07 -0800, "Simon"
<Simon@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>The two domains do not trust each other and the Network guys have no
>intention of changing this. However when i try and link the server with
>username and password I still can`t connect to run a query on the linked
>server.
>Si
>"Mike Epprecht (SQL MVP)" wrote:
>
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
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
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>
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.
Tuesday, March 20, 2012
Connections...
We are getting a lot of sleeping (and orphan) connections
to our database, so I would like to create a script to
kill them based upon them being sleeping for over 2 hours.
Can anyone point me to the table that holds this info ?
I don't want the script as I will be trying that myself.
TIA
JimThe table is master.dbo.sysprocesses...
Sleeping is not bad... It simply means that the connection is open but not
currently doing any work... Most connections will be in this state most of
the time. Also consider the effect of connection pooling...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:351b01c48f4a$17717580$a601280a@.phx.gbl...
> Dear All,
> We are getting a lot of sleeping (and orphan) connections
> to our database, so I would like to create a script to
> kill them based upon them being sleeping for over 2 hours.
> Can anyone point me to the table that holds this info ?
> I don't want the script as I will be trying that myself.
> TIA
> Jim
>|||Thanks Wayne,
In our case its usually because the data objects have made
a new connection, so what we have is a lot of unused
connections by the same person. Its those it want to get
rid of.
Thanks
Jim
>--Original Message--
>The table is master.dbo.sysprocesses...
>Sleeping is not bad... It simply means that the
connection is open but not
>currently doing any work... Most connections will be in
this state most of
>the time. Also consider the effect of connection
pooling...
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Mariner, Charlotte, NC
>www.mariner-usa.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>"Jimbo" <anonymous@.discussions.microsoft.com> wrote in
message
>news:351b01c48f4a$17717580$a601280a@.phx.gbl...
>> Dear All,
>> We are getting a lot of sleeping (and orphan)
connections
>> to our database, so I would like to create a script to
>> kill them based upon them being sleeping for over 2
hours.
>> Can anyone point me to the table that holds this info ?
>> I don't want the script as I will be trying that myself.
>> TIA
>> Jim
>>
>
>.
>|||If that's the case, either your programmers aren't properly cleaning up the
connections, or these connections are still in use by the data objects and
you'll cause headaches for your developers if you take this path.
Personally, I'd make them perform a code review and fix the problem - most
connection leaks are due to sloppy coding practices.
--
Michael D. Long
Microsoft MVP - Windows SDK
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:376e01c48f66$403ea520$a301280a@.phx.gbl...
> Thanks Wayne,
> In our case its usually because the data objects have made
> a new connection, so what we have is a lot of unused
> connections by the same person. Its those it want to get
> rid of.
> Thanks
> Jim
>
> >--Original Message--
> >The table is master.dbo.sysprocesses...
> >
> >Sleeping is not bad... It simply means that the
> connection is open but not
> >currently doing any work... Most connections will be in
> this state most of
> >the time. Also consider the effect of connection
> pooling...
> >
> >--
> >Wayne Snyder, MCDBA, SQL Server MVP
> >Mariner, Charlotte, NC
> >www.mariner-usa.com
> >(Please respond only to the newsgroups.)
> >
> >I support the Professional Association of SQL Server
> (PASS) and it's
> >community of SQL Server professionals.
> >www.sqlpass.org
> >
> >"Jimbo" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:351b01c48f4a$17717580$a601280a@.phx.gbl...
> >> Dear All,
> >> We are getting a lot of sleeping (and orphan)
> connections
> >> to our database, so I would like to create a script to
> >> kill them based upon them being sleeping for over 2
> hours.
> >>
> >> Can anyone point me to the table that holds this info ?
> >>
> >> I don't want the script as I will be trying that myself.
> >>
> >> TIA
> >> Jim
> >>
> >>
> >
> >
> >.
> >sqlsql
Connections...
We are getting a lot of sleeping (and orphan) connections
to our database, so I would like to create a script to
kill them based upon them being sleeping for over 2 hours.
Can anyone point me to the table that holds this info ?
I don't want the script as I will be trying that myself.
TIA
JimThe table is master.dbo.sysprocesses...
Sleeping is not bad... It simply means that the connection is open but not
currently doing any work... Most connections will be in this state most of
the time. Also consider the effect of connection pooling...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:351b01c48f4a$17717580$a601280a@.phx.gbl...
> Dear All,
> We are getting a lot of sleeping (and orphan) connections
> to our database, so I would like to create a script to
> kill them based upon them being sleeping for over 2 hours.
> Can anyone point me to the table that holds this info ?
> I don't want the script as I will be trying that myself.
> TIA
> Jim
>|||Thanks Wayne,
In our case its usually because the data objects have made
a new connection, so what we have is a lot of unused
connections by the same person. Its those it want to get
rid of.
Thanks
Jim
>--Original Message--
>The table is master.dbo.sysprocesses...
>Sleeping is not bad... It simply means that the
connection is open but not
>currently doing any work... Most connections will be in
this state most of
>the time. Also consider the effect of connection
pooling...
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Mariner, Charlotte, NC
>www.mariner-usa.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>"Jimbo" <anonymous@.discussions.microsoft.com> wrote in
message
>news:351b01c48f4a$17717580$a601280a@.phx.gbl...
connections[vbcol=seagreen]
hours.[vbcol=seagreen]
>
>.
>|||If that's the case, either your programmers aren't properly cleaning up the
connections, or these connections are still in use by the data objects and
you'll cause headaches for your developers if you take this path.
Personally, I'd make them perform a code review and fix the problem - most
connection leaks are due to sloppy coding practices.
Michael D. Long
Microsoft MVP - Windows SDK
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:376e01c48f66$403ea520$a301280a@.phx.gbl...[vbcol=seagreen]
> Thanks Wayne,
> In our case its usually because the data objects have made
> a new connection, so what we have is a lot of unused
> connections by the same person. Its those it want to get
> rid of.
> Thanks
> Jim
>
> connection is open but not
> this state most of
> pooling...
> (PASS) and it's
> message
> connections
> hours.
Connections...
We are getting a lot of sleeping (and orphan) connections
to our database, so I would like to create a script to
kill them based upon them being sleeping for over 2 hours.
Can anyone point me to the table that holds this info ?
I don't want the script as I will be trying that myself.
TIA
Jim
The table is master.dbo.sysprocesses...
Sleeping is not bad... It simply means that the connection is open but not
currently doing any work... Most connections will be in this state most of
the time. Also consider the effect of connection pooling...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:351b01c48f4a$17717580$a601280a@.phx.gbl...
> Dear All,
> We are getting a lot of sleeping (and orphan) connections
> to our database, so I would like to create a script to
> kill them based upon them being sleeping for over 2 hours.
> Can anyone point me to the table that holds this info ?
> I don't want the script as I will be trying that myself.
> TIA
> Jim
>
|||Thanks Wayne,
In our case its usually because the data objects have made
a new connection, so what we have is a lot of unused
connections by the same person. Its those it want to get
rid of.
Thanks
Jim
>--Original Message--
>The table is master.dbo.sysprocesses...
>Sleeping is not bad... It simply means that the
connection is open but not
>currently doing any work... Most connections will be in
this state most of
>the time. Also consider the effect of connection
pooling...
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Mariner, Charlotte, NC
>www.mariner-usa.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>"Jimbo" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:351b01c48f4a$17717580$a601280a@.phx.gbl...
connections[vbcol=seagreen]
hours.
>
>.
>
|||If that's the case, either your programmers aren't properly cleaning up the
connections, or these connections are still in use by the data objects and
you'll cause headaches for your developers if you take this path.
Personally, I'd make them perform a code review and fix the problem - most
connection leaks are due to sloppy coding practices.
Michael D. Long
Microsoft MVP - Windows SDK
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:376e01c48f66$403ea520$a301280a@.phx.gbl...[vbcol=seagreen]
> Thanks Wayne,
> In our case its usually because the data objects have made
> a new connection, so what we have is a lot of unused
> connections by the same person. Its those it want to get
> rid of.
> Thanks
> Jim
>
> connection is open but not
> this state most of
> pooling...
> (PASS) and it's
> message
> connections
> hours.
Thursday, March 8, 2012
Connection to ODBC without a DSN
directly without having to create a DSN before hand.
This would be great as dumb users can't handle creating a DSN.
Would be nice if I could ask them SQL Server or Oracle, server name, user
name and password only and programmatically connect with that amount of
information.
Tony
You can use an OLEDB connection which is better anyway... see
http://www.aspfaq.com/2126 for samples that work in VB and ASP, and the
basic structure should work from any client language that supports it...
http://www.aspfaq.com/
(Reverse address to reply.)
"Tony" <tonyng2@.spacecommand.net> wrote in message
news:eRxayfHjEHA.1344@.TK2MSFTNGP11.phx.gbl...
> Is it possible to connect to an ODBC driver (e.g. SQL Server or Oracle)
> directly without having to create a DSN before hand.
> This would be great as dumb users can't handle creating a DSN.
> Would be nice if I could ask them SQL Server or Oracle, server name, user
> name and password only and programmatically connect with that amount of
> information.
> Tony
>
|||Nope, not an option, would require a total recode of my database layer.
I'm required to continue using ODBC.
Application is C++/MFC client server application.
Thanks,
Tony
P.S. I have heard that OLEDB runs slightly slower due to COM marshaling.
What makes it a better choice from a C++ perspective?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:Of119iHjEHA.3608@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> You can use an OLEDB connection which is better anyway... see
> http://www.aspfaq.com/2126 for samples that work in VB and ASP, and the
> basic structure should work from any client language that supports it...
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Tony" <tonyng2@.spacecommand.net> wrote in message
> news:eRxayfHjEHA.1344@.TK2MSFTNGP11.phx.gbl...
user
>
|||You can use a dsn-less connection. Code the connection
string with the driver/provider you use in whatever syntax
is required for the data access api you are using with your
application.
OLE DB can provide more functionality and is generally
faster than ODBC.
-Sue
On Fri, 27 Aug 2004 16:17:36 -0500, "Tony"
<tonyng2@.spacecommand.net> wrote:
>Nope, not an option, would require a total recode of my database layer.
>I'm required to continue using ODBC.
>Application is C++/MFC client server application.
>Thanks,
>Tony
>P.S. I have heard that OLEDB runs slightly slower due to COM marshaling.
>What makes it a better choice from a C++ perspective?
>"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
>news:Of119iHjEHA.3608@.TK2MSFTNGP09.phx.gbl...
>user
>
|||To be more specific, you use SQLDriverConnect instead of SQLConnect.
You can even leverage the driver to prompt for the login information.
Here's an example:
SQLCHAR* connectionString = (SQLCHAR*)"driver={SQL
Server};database=mydatabase";
SQLDriverConnect(hdbc, hwnd, connectionString, SQL_NTS, NULL, 0, NULL,
SQL_DRIVER_PROMPT);
SQL_DRIVER_PROMPT will cause the driver to display a dialog prompting the
user for the server name and uid/pwd information.
As far as ODBC vs. OLEDB is concerned, OLEDB is nice, it is a lot more
flexible than ODBC, but it's also a lot more difficult to use. If you're
accessing simple, relational data, just use ODBC. If you're already using
ODBC, and you dont need some specific feature of OLEDB, just continue to use
ODBC.
Brannon
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:qp85j0pfp3pj7qgto5tt19arv0cp9ke86d@.4ax.com... [vbcol=seagreen]
> You can use a dsn-less connection. Code the connection
> string with the driver/provider you use in whatever syntax
> is required for the data access api you are using with your
> application.
> OLE DB can provide more functionality and is generally
> faster than ODBC.
> -Sue
> On Fri, 27 Aug 2004 16:17:36 -0500, "Tony"
> <tonyng2@.spacecommand.net> wrote:
it...[vbcol=seagreen]
Oracle)[vbcol=seagreen]
of
>
|||Thanks for the info.
I just need a way now to get the connection string used so I can save it for
next time.
Doesn't look like it gives it back to you.
Thanks,
Tony
"Brannon Jones" <brannonjNOSPAM@.gmail.com> wrote in message
news:uXeO4urjEHA.3624@.TK2MSFTNGP10.phx.gbl...
> To be more specific, you use SQLDriverConnect instead of SQLConnect.
> You can even leverage the driver to prompt for the login information.
> Here's an example:
> SQLCHAR* connectionString = (SQLCHAR*)"driver={SQL
> Server};database=mydatabase";
> SQLDriverConnect(hdbc, hwnd, connectionString, SQL_NTS, NULL, 0, NULL,
> SQL_DRIVER_PROMPT);
> SQL_DRIVER_PROMPT will cause the driver to display a dialog prompting the
> user for the server name and uid/pwd information.
> As far as ODBC vs. OLEDB is concerned, OLEDB is nice, it is a lot more
> flexible than ODBC, but it's also a lot more difficult to use. If you're
> accessing simple, relational data, just use ODBC. If you're already using
> ODBC, and you dont need some specific feature of OLEDB, just continue to
use[vbcol=seagreen]
> ODBC.
> Brannon
> "Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
> news:qp85j0pfp3pj7qgto5tt19arv0cp9ke86d@.4ax.com...
marshaling.[vbcol=seagreen]
the[vbcol=seagreen]
> it...
> Oracle)
name,[vbcol=seagreen]
amount
> of
>
|||Why doesn't it look like it gives it back to you?
My example is a basic example of how to use SQLDriverConnect().
There are parameters on SQLDriverConnect() that return the connection string
that was used to connect.
Brannon
"Tony" <tonyng2@.spacecommand.net> wrote in message
news:OaQO8iujEHA.2544@.TK2MSFTNGP10.phx.gbl...
> Thanks for the info.
> I just need a way now to get the connection string used so I can save it
for[vbcol=seagreen]
> next time.
> Doesn't look like it gives it back to you.
> Thanks,
> Tony
>
> "Brannon Jones" <brannonjNOSPAM@.gmail.com> wrote in message
> news:uXeO4urjEHA.3624@.TK2MSFTNGP10.phx.gbl...
the[vbcol=seagreen]
you're[vbcol=seagreen]
using[vbcol=seagreen]
> use
layer.
> marshaling.
> the
> name,
> amount
>
|||I guess I have brain damage today, my apologies. :-)
Thanks for the reply,
Tony
"Brannon Jones" <brannonjNOSPAM@.gmail.com> wrote in message
news:eeMEES6jEHA.3876@.TK2MSFTNGP15.phx.gbl...
> Why doesn't it look like it gives it back to you?
> My example is a basic example of how to use SQLDriverConnect().
> There are parameters on SQLDriverConnect() that return the connection
string[vbcol=seagreen]
> that was used to connect.
> Brannon
> "Tony" <tonyng2@.spacecommand.net> wrote in message
> news:OaQO8iujEHA.2544@.TK2MSFTNGP10.phx.gbl...
> for
> the
> you're
> using
to[vbcol=seagreen]
> layer.
and[vbcol=seagreen]
supports
>
Connection to ODBC without a DSN
directly without having to create a DSN before hand.
This would be great as dumb users can't handle creating a DSN.
Would be nice if I could ask them SQL Server or Oracle, server name, user
name and password only and programmatically connect with that amount of
information.
TonyYou can use an OLEDB connection which is better anyway... see
http://www.aspfaq.com/2126 for samples that work in VB and ASP, and the
basic structure should work from any client language that supports it...
http://www.aspfaq.com/
(Reverse address to reply.)
"Tony" <tonyng2@.spacecommand.net> wrote in message
news:eRxayfHjEHA.1344@.TK2MSFTNGP11.phx.gbl...
> Is it possible to connect to an ODBC driver (e.g. SQL Server or Oracle)
> directly without having to create a DSN before hand.
> This would be great as dumb users can't handle creating a DSN.
> Would be nice if I could ask them SQL Server or Oracle, server name, user
> name and password only and programmatically connect with that amount of
> information.
> Tony
>|||Nope, not an option, would require a total recode of my database layer.
I'm required to continue using ODBC.
Application is C++/MFC client server application.
Thanks,
Tony
P.S. I have heard that OLEDB runs slightly slower due to COM marshaling.
What makes it a better choice from a C++ perspective?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:Of119iHjEHA.3608@.TK2MSFTNGP09.phx.gbl...
> You can use an OLEDB connection which is better anyway... see
> http://www.aspfaq.com/2126 for samples that work in VB and ASP, and the
> basic structure should work from any client language that supports it...
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Tony" <tonyng2@.spacecommand.net> wrote in message
> news:eRxayfHjEHA.1344@.TK2MSFTNGP11.phx.gbl...
user[vbcol=seagreen]
>|||You can use a dsn-less connection. Code the connection
string with the driver/provider you use in whatever syntax
is required for the data access api you are using with your
application.
OLE DB can provide more functionality and is generally
faster than ODBC.
-Sue
On Fri, 27 Aug 2004 16:17:36 -0500, "Tony"
<tonyng2@.spacecommand.net> wrote:
>Nope, not an option, would require a total recode of my database layer.
>I'm required to continue using ODBC.
>Application is C++/MFC client server application.
>Thanks,
>Tony
>P.S. I have heard that OLEDB runs slightly slower due to COM marshaling.
>What makes it a better choice from a C++ perspective?
>"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
>news:Of119iHjEHA.3608@.TK2MSFTNGP09.phx.gbl...
>user
>|||To be more specific, you use SQLDriverConnect instead of SQLConnect.
You can even leverage the driver to prompt for the login information.
Here's an example:
SQLCHAR* connectionString = (SQLCHAR*)"driver={SQL
Server};database=mydatabase";
SQLDriverConnect(hdbc, hwnd, connectionString, SQL_NTS, NULL, 0, NULL,
SQL_DRIVER_PROMPT);
SQL_DRIVER_PROMPT will cause the driver to display a dialog prompting the
user for the server name and uid/pwd information.
As far as ODBC vs. OLEDB is concerned, OLEDB is nice, it is a lot more
flexible than ODBC, but it's also a lot more difficult to use. If you're
accessing simple, relational data, just use ODBC. If you're already using
ODBC, and you dont need some specific feature of OLEDB, just continue to use
ODBC.
Brannon
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:qp85j0pfp3pj7qgto5tt19arv0cp9ke86d@.
4ax.com...
> You can use a dsn-less connection. Code the connection
> string with the driver/provider you use in whatever syntax
> is required for the data access api you are using with your
> application.
> OLE DB can provide more functionality and is generally
> faster than ODBC.
> -Sue
> On Fri, 27 Aug 2004 16:17:36 -0500, "Tony"
> <tonyng2@.spacecommand.net> wrote:
>
it...[vbcol=seagreen]
Oracle)[vbcol=seagreen]
of[vbcol=seagreen]
>|||Thanks for the info.
I just need a way now to get the connection string used so I can save it for
next time.
Doesn't look like it gives it back to you.
Thanks,
Tony
"Brannon Jones" <brannonjNOSPAM@.gmail.com> wrote in message
news:uXeO4urjEHA.3624@.TK2MSFTNGP10.phx.gbl...
> To be more specific, you use SQLDriverConnect instead of SQLConnect.
> You can even leverage the driver to prompt for the login information.
> Here's an example:
> SQLCHAR* connectionString = (SQLCHAR*)"driver={SQL
> Server};database=mydatabase";
> SQLDriverConnect(hdbc, hwnd, connectionString, SQL_NTS, NULL, 0, NULL,
> SQL_DRIVER_PROMPT);
> SQL_DRIVER_PROMPT will cause the driver to display a dialog prompting the
> user for the server name and uid/pwd information.
> As far as ODBC vs. OLEDB is concerned, OLEDB is nice, it is a lot more
> flexible than ODBC, but it's also a lot more difficult to use. If you're
> accessing simple, relational data, just use ODBC. If you're already using
> ODBC, and you dont need some specific feature of OLEDB, just continue to
use
> ODBC.
> Brannon
> "Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
> news:qp85j0pfp3pj7qgto5tt19arv0cp9ke86d@.
4ax.com...
marshaling.[vbcol=seagreen]
the[vbcol=seagreen]
> it...
> Oracle)
name,[vbcol=seagreen]
amount[vbcol=seagreen]
> of
>|||Why doesn't it look like it gives it back to you?
My example is a basic example of how to use SQLDriverConnect().
There are parameters on SQLDriverConnect() that return the connection string
that was used to connect.
Brannon
"Tony" <tonyng2@.spacecommand.net> wrote in message
news:OaQO8iujEHA.2544@.TK2MSFTNGP10.phx.gbl...
> Thanks for the info.
> I just need a way now to get the connection string used so I can save it
for
> next time.
> Doesn't look like it gives it back to you.
> Thanks,
> Tony
>
> "Brannon Jones" <brannonjNOSPAM@.gmail.com> wrote in message
> news:uXeO4urjEHA.3624@.TK2MSFTNGP10.phx.gbl...
the[vbcol=seagreen]
you're[vbcol=seagreen]
using[vbcol=seagreen]
> use
layer.[vbcol=seagreen]
> marshaling.
> the
> name,
> amount
>|||I guess I have brain damage today, my apologies. :-)
Thanks for the reply,
Tony
"Brannon Jones" <brannonjNOSPAM@.gmail.com> wrote in message
news:eeMEES6jEHA.3876@.TK2MSFTNGP15.phx.gbl...
> Why doesn't it look like it gives it back to you?
> My example is a basic example of how to use SQLDriverConnect().
> There are parameters on SQLDriverConnect() that return the connection
string
> that was used to connect.
> Brannon
> "Tony" <tonyng2@.spacecommand.net> wrote in message
> news:OaQO8iujEHA.2544@.TK2MSFTNGP10.phx.gbl...
> for
> the
> you're
> using
to[vbcol=seagreen]
> layer.
and[vbcol=seagreen]
supports[vbcol=seagreen]
>
Wednesday, March 7, 2012
Connection to database problems
Hi,
I am trying to create a program in VS2005 - C# that uses SQL Express as it's database.
Here is the connection string:
@."Data Source=(local)\SQLEXPRESS;Initial Catalog=MyBookings;Integrated Security=True";
Here is the result from the log file:
2007-03-21 10:49:44.36 Logon Login failed for user 'AQUARIUS\Administrator'. [CLIENT: <local machine>]
I could play with this manually and probably get it working BUT this is a solution that is to be installed on computers by users who will have no knowledge of SQL Express.
The database needs to be accessible by the program without user intervention.
How do I go about this or fix the above problem?
Thanks.
hi,
the connection string is correct, so you should check the actual connecting Windows login has been granted connection permissions to the Express instance...
loosely speaking, SQL Server manages security using a so called "2 phases" authentication policy..
the first one is dedicated to connection action, where the provided credentials are validated against the granted logins "list"... granted logins are "principals", both standard SQL Server logins (requiring explicit user name and password credentials) and Windows logins (where only the relative sid is provided as credential as already authenticated by the domain controller/computer they are member of) that have been granted permissions to log in the specified SQL Server instance... for standard logins, like "sa", you have to manage each specific login, where, for Windows logins, you can both manage them at single login granularity as long as at Group granularity..
So, for Windows logins, you can grant connection permissions at "AQUARIUS\AccountName" or, for group management, at "AQUARIUS\GroupName" the specified account is member of...
by default, SQL Server 2005 grants login permissions for integrated security validated connections at LocalAdministrators (BUILTIN\Administrators) and LocalUsers (BUILTIN\Users) members, but you have to manage as required further logins or groups, as long as to a special standard SQL Server login, "sa", if non integrated security (or "mixed security") connections have been enabled as well..
If the provided credentials can not be validated, the connection is refused and the exception you provided is raised...
when the first security phase has been positively validated, SQL Server proceeds in the second one, regarding database access to the specified one... every kind of server level principal but members of the sysadmins server role requires explicit database access permission via a mapping to a database level principal, usually known as a "database user"..
when resolved, the particular login, mapped to a specified database user, can "access" the specified database... then additional security factors comes to play, to permit security constraints at database object level, like table, view, stored procedure, ...., and with more granularity as well, at column level for tables and views database objects, in order to grant permissions according to the required security path, so that only particular database principals can execute the particular stored procedure(s) or select from the particular table(s) or update the particular table(s)...
regards
|||if your DB is in Local computer use this
SqlConnection myConnection = new SqlConnection("server=(local)\\SQLEXPRESS;Integrated Security=SSPI;database=yourDBname");
if your DB is in App_Data folder use this
SqlConnection myConnection = new SqlConnection("Data Source=.\\SQLEXPRESS; AttachDbFilename=|DataDirectory|\\yourDBname.mdf;Integrated Security=True;User Instance=True");
Thanks
www.sqltree.com
Connection timeout when generating recordset from a stored procedure in an ASP page
create the database connection and view the tables and stored procedures.
When I try to create a stored procedure binding I can choose the connection
and the procedure. But when I check "Returns DataSet" and click Test... I
get the following Dreamweaver error after a minute or so:
A server timeout has occured. Here are the possible reasons.
1. Please make sure that the webserver is up and running.
2. Please verify that the ODBC DSN exists on the testing server.
Executing the stored procedure in SQL Query Analyzer returns results in less
than 5 seconds.
My webserver is up and running and the web.config file is the same on both
the local machine and testing server. The SQL server and webserver are
different machines. My stored procedure is below.
I can create datasets (querys) on the database tables. It's only when I try
to generate a dataset from a stored procedure that run into problems.
If it matters I'm using ASP.NET VB, SQL Server 2000, IIS 5.0, .NET 1.1 and
Dreamweaver MX 2004.
Please help, I'm at a standstill.
I get the same problem when using VB .NET to to create the ASP page. If I
use Coldfusion instead on ASP it works flawlessly. Only problem is I that
have a developers license for Coldfusion so this is not an acceptable
workaround.
Thanks in advance!! My stored procedure is below:
CREATE PROCEDURE proc_combinedDB
(@.platform varchar(40), @.server varchar(40),@.keyword varchar(50))
WITH RECOMPILE
AS
SELECT *
FROM [prtracker_classworks].[dbo].[Problem Reports]
WHERE [Workstation OS] LIKE @.platform AND [Server OS] LIKE @.server A
ND
Details LIKE @.keyword
UNION ALL
SELECT *
FROM [prtracker_mac bugs].[dbo].[Problem Reports]
WHERE [Workstation OS] LIKE @.platform AND [Server OS]
LIKE @.server AND Details LIKE @.keyword
UNION ALL
SELECT *
FROM [Prtracker_Arizona State Edition].[dbo].[Problem Re
ports]
WHERE [Workstation OS] LIKE @.platform AND [Server OS] LIKE @.server A
ND
Details LIKE @.keyword
... // And so on for 15 more databases
RETURN
GOHi,
I am getting the same error using DWMX 2004 / ASP / VB.
Did you found a workaround ?
If so, your help is greatly apreciated.
axiaxi2003@.hotmail.com
A
amucino
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message466748.html
Connection timeout problem
Using ado/ole-db, I create a connection to a database (SQL 2000) specifying
a time-out value of 43200 (which should equate to 12 hours).
I then create a command and use the active connection and also take the
added precaution (which is probably pointless) of setting the command
timeout value to also be 12 hours.
I then execute some SQL that has been dynamically prepared (and could take
many hours to complete) and run this. However, I get an error in the
Application event log showing that the connection timed-out. This doesn't
happen everytime - most times it connects and runs flawlessly... The error
details for the timeout are:
Err.Number = -214746759
Err.Description = Timeout expired
And this occurs in the region of approximately 1 minute after the code was
initialised (the machine is ultra busy at this time).
I may well be wrong here, but I assume that it wasn't the connection that
timed out (i.e. was made and then was dropped) but that there's a specified
time allowed to make the connection and that it's this allowed time that is
too short - remember, the machine is ultra busy at this time). If I am
right in this assumption then I need a way of telling it not to give up
quite so quickly (or to retry several hundred times). Any insight as to
what might be happening and any suggestions concerning how to fix this would
be most welcome.
I include my code below (error handling and app logging removed for
clarity):
' Declarations
Dim oCmd As ADODB.Command
Dim oCn As ADODB.Connection
Dim lTimeOut As Long
'--
' Set the timeout ( = 43200 seconds = 12 hours)
lTimeOut = CLng(mIni.iniKeyValue(mIni.computerName, "timeOut"))
'--
' Create a new connection to the database
Set oCn = New ADODB.Connection
With oCn
.ConnectionString = mIni.iniKeyValue(computerName,
"connectionString")
.CommandTimeout = lTimeOut
.Open
End With
'--
' Instantiate the command object
Set oCmd = New ADODB.Command
With oCmd
'--
Set .ActiveConnection = oCn
.CommandType = adCmdText
.CommandText = sSQL
.CommandTimeout = lTimeOut
'--
' Execute the SQL
.Execute
'--
' Disconnect command
Set .ActiveConnection = Nothing
'--
End With
'--
' Trash the command and connection objects
oCn.Close
Set oCn = Nothing
Set oCmd = Nothing
'--
Many thanks in advance
GriffHi GriffithsJ, try using CommandTimeout = 0.
Vctor Koch From Argentina.
"GriffithsJ" <GriffithsJ_520@.hotmail.com> escribi en el mensaje
news:uzXSsXp2DHA.2060@.TK2MSFTNGP10.phx.gbl...
quote:
> Hi
> Using ado/ole-db, I create a connection to a database (SQL 2000)
specifying
quote:
> a time-out value of 43200 (which should equate to 12 hours).
> I then create a command and use the active connection and also take the
> added precaution (which is probably pointless) of setting the command
> timeout value to also be 12 hours.
> I then execute some SQL that has been dynamically prepared (and could take
> many hours to complete) and run this. However, I get an error in the
> Application event log showing that the connection timed-out. This doesn't
> happen everytime - most times it connects and runs flawlessly... The
error
quote:
> details for the timeout are:
> Err.Number = -214746759
> Err.Description = Timeout expired
> And this occurs in the region of approximately 1 minute after the code was
> initialised (the machine is ultra busy at this time).
> I may well be wrong here, but I assume that it wasn't the connection that
> timed out (i.e. was made and then was dropped) but that there's a
specified
quote:
> time allowed to make the connection and that it's this allowed time that
is
quote:
> too short - remember, the machine is ultra busy at this time). If I am
> right in this assumption then I need a way of telling it not to give up
> quite so quickly (or to retry several hundred times). Any insight as to
> what might be happening and any suggestions concerning how to fix this
would
quote:|||> Hi GriffithsJ, try using CommandTimeout = 0.
> be most welcome.
> I include my code below (error handling and app logging removed for
> clarity):
> ' Declarations
> Dim oCmd As ADODB.Command
> Dim oCn As ADODB.Connection
> Dim lTimeOut As Long
> '--
> ' Set the timeout ( = 43200 seconds = 12 hours)
> lTimeOut = CLng(mIni.iniKeyValue(mIni.computerName, "timeOut"))
> '--
> ' Create a new connection to the database
> Set oCn = New ADODB.Connection
> With oCn
> .ConnectionString = mIni.iniKeyValue(computerName,
> "connectionString")
> .CommandTimeout = lTimeOut
> .Open
> End With
> '--
> ' Instantiate the command object
> Set oCmd = New ADODB.Command
> With oCmd
> '--
> Set .ActiveConnection = oCn
> .CommandType = adCmdText
> .CommandText = sSQL
> .CommandTimeout = lTimeOut
> '--
> ' Execute the SQL
> .Execute
> '--
> ' Disconnect command
> Set .ActiveConnection = Nothing
> '--
> End With
> '--
> ' Trash the command and connection objects
> oCn.Close
> Set oCn = Nothing
> Set oCmd = Nothing
> '--
> Many thanks in advance
> Griff
>
quote:
> --
That's the equivalent of saying infinite...
Two things.
First is that I'm always a little cautious about using infinite values, I'd
prefer to set values to very large finite values - that way, server
resources should eventually tidy themselves up.
Second is that I had a commandTimeout value of 12 hours and it died within a
minute. I'm not sure who increasing the commandTimeout value from 12 hours
to infinite would affect it being killed off in under a minute (unless
setting it to 0 has any other special effects I'm not aware of.)
Griff|||Hi Griff,
quote:
> I then create a command and use the active connection and also take the
> added precaution (which is probably pointless) of setting the command
> timeout value to also be 12 hours.
Command.CommandTimeout must be explicitly set as you did.
It is not passed over from the Connection.CommandTimeout
when assigning the Command.ActiveConnection from there.
So the taken precaution is obligatory.
quote:
> I then execute some SQL that has been dynamically prepared (and could take
> many hours to complete) and run this. However, I get an error in the
> Application event log showing that the connection timed-out. This doesn't
> happen everytime - most times it connects and runs flawlessly... The erro
r
> details for the timeout are:
You mean the c o n n e c t i o n times out, not the command, right?
When does it time out - when oCn.Open is executed or where?
If so, increase the ConnectionTimeout of oCn before Open
so that it waits longer to establish the connection:
quote:
> With oCn
> .ConnectionString = mIni.iniKeyValue(computerName,
> "connectionString")
> .CommandTimeout = lTimeOut
.ConnectionTimeout = 300 '****************************
quote:
> .Open
quote:
> End With
However, if you mean that the c o m m a n d times out at oCmd.Execute,
check whether oCmd.CommandTimeout has indeed the intended 43200 at that time
and whether it is really a command timeout or a connection error.
quote:
> Err.Number = -214746759
The error number might be wrong. Could be -2147467259 (the notorious 8000400
5H).
Regards,
Frank
Message sent 14 Jan 2004 15:19:22 GMT|||Hi Frank
Many thanks for that answer...I've made all the necessary changes as you
suggested and have uploaded the compiled code.
Will find out tomorrow morning whether this worked...
Thanks
Griff|||> Using ado/ole-db, I create a connection to a database (SQL 2000)
specifying
quote:
> a time-out value of 43200 (which should equate to 12 hours).
> I then create a command and use the active connection and also take the
> added precaution (which is probably pointless) of setting the command
> timeout value to also be 12 hours.
Comand timeout is seperate from connection timeout.
http://www.devguru.com/Technologies...andtimeout.html
Try the command GUI in a adoanywhere command gui.
http://www.adoanywhere.com/help/command.htm#Command
Mike Collier
http://www.adoanywhere.com
http://www.adoanywhere.com/forum
"GriffithsJ" <GriffithsJ_520@.hotmail.com> wrote in message
news:uzXSsXp2DHA.2060@.TK2MSFTNGP10.phx.gbl...
quote:
> Hi
> Using ado/ole-db, I create a connection to a database (SQL 2000)
specifying
quote:
> a time-out value of 43200 (which should equate to 12 hours).
> I then create a command and use the active connection and also take the
> added precaution (which is probably pointless) of setting the command
> timeout value to also be 12 hours.
> I then execute some SQL that has been dynamically prepared (and could take
> many hours to complete) and run this. However, I get an error in the
> Application event log showing that the connection timed-out. This doesn't
> happen everytime - most times it connects and runs flawlessly... The
error
quote:
> details for the timeout are:
> Err.Number = -214746759
> Err.Description = Timeout expired
> And this occurs in the region of approximately 1 minute after the code was
> initialised (the machine is ultra busy at this time).
> I may well be wrong here, but I assume that it wasn't the connection that
> timed out (i.e. was made and then was dropped) but that there's a
specified
quote:
> time allowed to make the connection and that it's this allowed time that
is
quote:
> too short - remember, the machine is ultra busy at this time). If I am
> right in this assumption then I need a way of telling it not to give up
> quite so quickly (or to retry several hundred times). Any insight as to
> what might be happening and any suggestions concerning how to fix this
would
quote:
> be most welcome.
> I include my code below (error handling and app logging removed for
> clarity):
> ' Declarations
> Dim oCmd As ADODB.Command
> Dim oCn As ADODB.Connection
> Dim lTimeOut As Long
> '--
> ' Set the timeout ( = 43200 seconds = 12 hours)
> lTimeOut = CLng(mIni.iniKeyValue(mIni.computerName, "timeOut"))
> '--
> ' Create a new connection to the database
> Set oCn = New ADODB.Connection
> With oCn
> .ConnectionString = mIni.iniKeyValue(computerName,
> "connectionString")
> .CommandTimeout = lTimeOut
> .Open
> End With
> '--
> ' Instantiate the command object
> Set oCmd = New ADODB.Command
> With oCmd
> '--
> Set .ActiveConnection = oCn
> .CommandType = adCmdText
> .CommandText = sSQL
> .CommandTimeout = lTimeOut
> '--
> ' Execute the SQL
> .Execute
> '--
> ' Disconnect command
> Set .ActiveConnection = Nothing
> '--
> End With
> '--
> ' Trash the command and connection objects
> oCn.Close
> Set oCn = Nothing
> Set oCmd = Nothing
> '--
> Many thanks in advance
> Griff
>
Saturday, February 25, 2012
Connection String with Named Instance and Port?
string that will allow me to connect to a named instance on a
non-standard port. I can't get the syntax right, can anyone show an
example?
Thanks.
For data source, use YourServer\YourNamedInstance then a
comma followed by the port number - e.g.
Data Source=YourServer\NamedInstance,1433;
-Sue
On 23 Mar 2006 06:38:16 -0800, bradwiseathome@.hotmail.com
wrote:
>I am trying to create a SQL Server 2000 and 2005-friendly connection
>string that will allow me to connect to a named instance on a
>non-standard port. I can't get the syntax right, can anyone show an
>example?
>Thanks.
Connection String with Named Instance and Port?
string that will allow me to connect to a named instance on a
non-standard port. I can't get the syntax right, can anyone show an
example?
Thanks.For data source, use YourServer\YourNamedInstance then a
comma followed by the port number - e.g.
Data Source=YourServer\NamedInstance,1433;
-Sue
On 23 Mar 2006 06:38:16 -0800, bradwiseathome@.hotmail.com
wrote:
>I am trying to create a SQL Server 2000 and 2005-friendly connection
>string that will allow me to connect to a named instance on a
>non-standard port. I can't get the syntax right, can anyone show an
>example?
>Thanks.
Connection String with Named Instance and Port?
string that will allow me to connect to a named instance on a
non-standard port. I can't get the syntax right, can anyone show an
example?
Thanks.For data source, use YourServer\YourNamedInstance then a
comma followed by the port number - e.g.
Data Source=YourServer\NamedInstance,1433;
-Sue
On 23 Mar 2006 06:38:16 -0800, bradwiseathome@.hotmail.com
wrote:
>I am trying to create a SQL Server 2000 and 2005-friendly connection
>string that will allow me to connect to a named instance on a
>non-standard port. I can't get the syntax right, can anyone show an
>example?
>Thanks.
Friday, February 24, 2012
Connection string question
I'm not sure the best place to put this:
I need help for creating a connection string in VS.Net 2.0. The line that I'm using to create my sql connections is:
<CODE>
Dim connDBAsNew SqlConnection(ConfigurationManager.ConnectionString("TEST").ConnectionString)</CODE>
"TEST" information is located in the machine.config file.
Anyways, when I type in the line above listed inside the <CODE> brackets, I get the following squiqqly line error under the Configuration Manager
<ERROR>
Name 'ConfigurationManager' is not declared.
</ERROR>
Do I need additional code in my web.config file or somewhere else to use ConfigurationManager? Thanks.
You're probably missing a reference to System.Configuration. It's also ConnectionStrings(), not ConnectionString(). Since it's from Web.config, I normally do it this way:
Imports System.Web.Configuration
Dim connDB As New SqlConnection(WebConfigurationManager.ConnectionStrings("TEST").ConnectionString)
HTH,
Ryan