Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Thursday, March 29, 2012

credentials of the user datasource

Hi,

I'd like to programme the execution of a report through the execution property option. However, when I try to do it a message error appears related to credentials of the datasource.

The present action is impossible to complete, because the credentials of the user datasource needed to execute this report are not stored on report server database.

I've tried all possible combinations.

Any idea?

Thanks.

Please set user name and password of the user datasource

following is the sample code to set it.

Microsoft.Reporting.WebForms.DataSourceCredentials[] crd = new Microsoft.Reporting.WebForms.DataSourceCredentials[1];

crd[0] = new Microsoft.Reporting.WebForms.DataSourceCredentials();

crd[0].Name = "DatasourceName";

crd[0].UserId = User;

crd[0].Password = Pwd;

ReportViewer.ServerReport.SetDataSourceCredentials(crd);

If you are using multiple data sources you need to set credentials for each datasource..

please set datasource credentials after setting report and parameter of the report to report viewer..

|||

By "programme the execution of a report through the execution property option" you don't by any chance mean "I want to set up a snapshot or scheduled report through the Executioin panel of the Properties tab of the Report Manager"?

If this is what you mean, then the message means exactly what it says: the datasource has to have its credentials stored with it (whether it is a shared datasource or one embedded in the report).

If the datasource is set up to run with the credentials of the logged-in user, then it can't be queried when there is no logged-in user (such as when you want a snapshot to execute). Doesn't that make sense?

So... how is the data set up for your report? And with what type(s) of credentials is it accessed?

>L<

Credentials not being passed with remote access

I cannot remotely access SQL Server 2005 with Windows Authentication with a
specific login (I get the error 18452 "this user is not associated with a
trusted login.."). I ran a trace with the profiler and it shows that no
values are being passed for the login/credentials.
I can login to the server locally just fine with the login.
Windows Authentication works with the same login work against another SQL
Server machine.
What could be specific to the login or the server that would cause the
credentials not to be passed.
--
John Shahan> What could be specific to the login or the server that would cause the
> credentials not to be passed.
This could be caused by a firewall issue with domain controller
communication. I've also seen this problem due to a time sync issue between
the client and servers.
Hope this helps.
Dan Guzman
SQL Server MVP
"jp" <jp@.discussions.microsoft.com> wrote in message
news:4B43E6E3-D0F0-4084-AED0-6D4139DA79CB@.microsoft.com...
>I cannot remotely access SQL Server 2005 with Windows Authentication with a
> specific login (I get the error 18452 "this user is not associated with a
> trusted login.."). I ran a trace with the profiler and it shows that no
> values are being passed for the login/credentials.
> I can login to the server locally just fine with the login.
> Windows Authentication works with the same login work against another SQL
> Server machine.
> What could be specific to the login or the server that would cause the
> credentials not to be passed.
> --
> John Shahan|||Dan, thank you for your response. I have seen you post helpful information
for many people before.
We looked at the time sync yesterday and it is close.
The odd thing is that it is specific to one login. Login "johnx" does not
pass credentials from any machine. My other login "johnz" works from any
machine. Also, no other users are reporting this problem with their login.
That being the case, do you still think it could be a firewall issue and if
so, what would I look for in the firewall configuration?
And again, to make it more frustrating, "johnx" can use Windows
Authentication on another SQL Server on the same domain with no problem.
John Shahan
"Dan Guzman" wrote:

> This could be caused by a firewall issue with domain controller
> communication. I've also seen this problem due to a time sync issue betwe
en
> the client and servers.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "jp" <jp@.discussions.microsoft.com> wrote in message
> news:4B43E6E3-D0F0-4084-AED0-6D4139DA79CB@.microsoft.com...
>|||> That being the case, do you still think it could be a firewall issue and
> if
> so, what would I look for in the firewall configuration?
If other users can successfully login with Windows authentication from the
same machines that fail with "john", then it's probably not a firewall
issue. Furthermore, since "johnx" can successfully login locally, it
appears "johnx" is setup correctly in SQL Server.
The main difference between local and remote access is the communication
protocol. Local access usually uses LCP but remote access is usually done
via TCP/IP or Named Pipes (as specified by the cliconfg.exe utility). Named
pipes requires the Windows account to have the "access this computer from
the network" right so make sure "johnx" has the right (via group membership)
if you are using Named Pipes.
After a successful connection of your working account, you can verify the
connection protocol with:
SELECT net_library
FROM master..sysprocesses
WHERE spid = @.@.spid
If you still can't sort this out, try to connect using SSMS and post the
full error message text here.
Hope this helps.
Dan Guzman
SQL Server MVP
"jp" <jp@.discussions.microsoft.com> wrote in message
news:FC3706EE-CE61-47EE-85A4-DEDDA3A633F6@.microsoft.com...[vbcol=seagreen]
> Dan, thank you for your response. I have seen you post helpful
> information
> for many people before.
> We looked at the time sync yesterday and it is close.
> The odd thing is that it is specific to one login. Login "johnx" does not
> pass credentials from any machine. My other login "johnz" works from any
> machine. Also, no other users are reporting this problem with their
> login.
> That being the case, do you still think it could be a firewall issue and
> if
> so, what would I look for in the firewall configuration?
> And again, to make it more frustrating, "johnx" can use Windows
> Authentication on another SQL Server on the same domain with no problem.
> --
> John Shahan
>
> "Dan Guzman" wrote:
>|||Dan, thanks again for your help. I wanted to share what apparently turned
out to be the solution.
johnx was set up as a local login on sql server. Removing that login
allowed windows authentication to work,
John Shahan
"Dan Guzman" wrote:

> If other users can successfully login with Windows authentication from the
> same machines that fail with "john", then it's probably not a firewall
> issue. Furthermore, since "johnx" can successfully login locally, it
> appears "johnx" is setup correctly in SQL Server.
> The main difference between local and remote access is the communication
> protocol. Local access usually uses LCP but remote access is usually done
> via TCP/IP or Named Pipes (as specified by the cliconfg.exe utility). Nam
ed
> pipes requires the Windows account to have the "access this computer from
> the network" right so make sure "johnx" has the right (via group membershi
p)
> if you are using Named Pipes.
> After a successful connection of your working account, you can verify the
> connection protocol with:
> SELECT net_library
> FROM master..sysprocesses
> WHERE spid = @.@.spid
> If you still can't sort this out, try to connect using SSMS and post the
> full error message text here.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "jp" <jp@.discussions.microsoft.com> wrote in message
> news:FC3706EE-CE61-47EE-85A4-DEDDA3A633F6@.microsoft.com...
>|||> johnx was set up as a local login on sql server. Removing that login
> allowed windows authentication to work,
I had assumed johnx was a domain user rather than a local Windows account.
I'm glad you got it working.
Dan Guzman
SQL Server MVP
"jp" <jp@.discussions.microsoft.com> wrote in message
news:36AE4208-0F21-4B0C-A735-4F9663FC812C@.microsoft.com...[vbcol=seagreen]
> Dan, thanks again for your help. I wanted to share what apparently turned
> out to be the solution.
> johnx was set up as a local login on sql server. Removing that login
> allowed windows authentication to work,
> --
> John Shahan
>
> "Dan Guzman" wrote:
>

Credentials Error

I have been trying to use stored credentials with a data source, but I always
get a "login failed" with "Not associated with a trusted SQL Server
connection" as the reason. I am running Report Server on Windows 2000. The
login I am trying to use exists in SQL Server. I have tried different logins
and different servers, always with the same results. Any suggestions?SQL may be set to only allow windows authentication. In enterprise manager,
go to the properties of your server --> security tab and check the
authentication section.
Mike G.
"Falcon" <Falcon@.discussions.microsoft.com> wrote in message
news:10F85238-51F3-466F-9A07-1831B8C0688F@.microsoft.com...
>I have been trying to use stored credentials with a data source, but I
>always
> get a "login failed" with "Not associated with a trusted SQL Server
> connection" as the reason. I am running Report Server on Windows 2000. The
> login I am trying to use exists in SQL Server. I have tried different
> logins
> and different servers, always with the same results. Any suggestions?

Credential error when using SSPI

I have a SQL Server database that I am able to connect to using Visual
Studio 2005 Server Explorer. However, when I attempt to establish a
connection in a C# program using SSPI, I get a login failure using the same
credentials used with Server Explorer.
Does anyone know what might cause this?Double check and make sure that your connection string is spelled correctly.
I sometimes like using ODBC manager to double check to make sure the
connection works that way. It uses your windows credentials as does SSIS
should you choose to look at it that way.
thanks,
/*
Warren Brunk - MCITP - SQL 2005, MCDBA
www.techintsolutions.com
*/
"William" <nfr@.nospam.com> wrote in message
news:eR058I11GHA.1268@.TK2MSFTNGP02.phx.gbl...
>I have a SQL Server database that I am able to connect to using Visual
>Studio 2005 Server Explorer. However, when I attempt to establish a
>connection in a C# program using SSPI, I get a login failure using the same
>credentials used with Server Explorer.
> Does anyone know what might cause this?
>

Tuesday, March 27, 2012

Creating Views

I get the following error when i create views in a batch
using 'sql query analyser' as I want to create all the
views at one go. Is there solution.
Server: Msg 156, Level 15, State 1, Procedure View1, Line
11
Incorrect syntax near the keyword 'CREATE'.
Server: Msg 111, Level 15, State 1, Procedure View2, Line
11
'CREATE VIEW' must be the first statement in a query batch.
Make sure the=20
GO
keyword appears between each statement
CREATE VIEW <name>=20
AS
SELECT...
GO
CREATE VIEW <name>=20
AS
SELECT...
GO
--=20
Keith
"BILLI98" <billi98@.hotmail.com> wrote in message =
news:423401c42b7e$8b4560f0$a401280a@.phx.gbl...
> I get the following error when i create views in a batch=20
> using 'sql query analyser' as I want to create all the=20
> views at one go. Is there solution.
>=20
>=20
> Server: Msg 156, Level 15, State 1, Procedure View1, Line=20
> 11
> Incorrect syntax near the keyword 'CREATE'.
> Server: Msg 111, Level 15, State 1, Procedure View2, Line=20
> 11
> 'CREATE VIEW' must be the first statement in a query batch.
>=20
>=20
>
|||On Mon, 26 Apr 2004 04:06:37 -0700, BILLI98 wrote:

>I get the following error when i create views in a batch
>using 'sql query analyser' as I want to create all the
>views at one go. Is there solution.
>
>Server: Msg 156, Level 15, State 1, Procedure View1, Line
>11
>Incorrect syntax near the keyword 'CREATE'.
>Server: Msg 111, Level 15, State 1, Procedure View2, Line
>11
>'CREATE VIEW' must be the first statement in a query batch.
Just put in a "go" before each CREATE VIEW. Make sure you put GO at
the beginning of the line. Like this:
CREATE VIEW TestView
AS SELECT au_id FROM authors
GO
CREATE VIEW TestView2
AS SELECT au_lname FROM authors
GO
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)

Creating Views

I get the following error when i create views in a batch
using 'sql query analyser' as I want to create all the
views at one go. Is there solution.
Server: Msg 156, Level 15, State 1, Procedure View1, Line
11
Incorrect syntax near the keyword 'CREATE'.
Server: Msg 111, Level 15, State 1, Procedure View2, Line
11
'CREATE VIEW' must be the first statement in a query batch.Make sure the GO
keyword appears between each statement
CREATE VIEW <name> AS
SELECT...
GO
CREATE VIEW <name> AS
SELECT...
GO
-- Keith
"BILLI98" <billi98@.hotmail.com> wrote in message =news:423401c42b7e$8b4560f0$a401280a@.phx.gbl...
> I get the following error when i create views in a batch > using 'sql query analyser' as I want to create all the > views at one go. Is there solution.
> > > Server: Msg 156, Level 15, State 1, Procedure View1, Line > 11
> Incorrect syntax near the keyword 'CREATE'.
> Server: Msg 111, Level 15, State 1, Procedure View2, Line > 11
> 'CREATE VIEW' must be the first statement in a query batch.
> > >|||On Mon, 26 Apr 2004 04:06:37 -0700, BILLI98 wrote:
>I get the following error when i create views in a batch
>using 'sql query analyser' as I want to create all the
>views at one go. Is there solution.
>
>Server: Msg 156, Level 15, State 1, Procedure View1, Line
>11
>Incorrect syntax near the keyword 'CREATE'.
>Server: Msg 111, Level 15, State 1, Procedure View2, Line
>11
>'CREATE VIEW' must be the first statement in a query batch.
Just put in a "go" before each CREATE VIEW. Make sure you put GO at
the beginning of the line. Like this:
CREATE VIEW TestView
AS SELECT au_id FROM authors
GO
CREATE VIEW TestView2
AS SELECT au_lname FROM authors
GO
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Creating Views

I get the following error when i create views in a batch
using 'sql query analyser' as I want to create all the
views at one go. Is there solution.
Server: Msg 156, Level 15, State 1, Procedure View1, Line
11
Incorrect syntax near the keyword 'CREATE'.
Server: Msg 111, Level 15, State 1, Procedure View2, Line
11
'CREATE VIEW' must be the first statement in a query batch.Make sure the=20
GO
keyword appears between each statement
CREATE VIEW <name>=20
AS
SELECT...
GO
CREATE VIEW <name>=20
AS
SELECT...
GO
--=20
Keith
"BILLI98" <billi98@.hotmail.com> wrote in message =
news:423401c42b7e$8b4560f0$a401280a@.phx.gbl...
> I get the following error when i create views in a batch=20
> using 'sql query analyser' as I want to create all the=20
> views at one go. Is there solution.
>=20
>=20
> Server: Msg 156, Level 15, State 1, Procedure View1, Line=20
> 11
> Incorrect syntax near the keyword 'CREATE'.
> Server: Msg 111, Level 15, State 1, Procedure View2, Line=20
> 11
> 'CREATE VIEW' must be the first statement in a query batch.
>=20
>=20
>|||On Mon, 26 Apr 2004 04:06:37 -0700, BILLI98 wrote:

>I get the following error when i create views in a batch
>using 'sql query analyser' as I want to create all the
>views at one go. Is there solution.
>
>Server: Msg 156, Level 15, State 1, Procedure View1, Line
>11
>Incorrect syntax near the keyword 'CREATE'.
>Server: Msg 111, Level 15, State 1, Procedure View2, Line
>11
>'CREATE VIEW' must be the first statement in a query batch.
Just put in a "go" before each CREATE VIEW. Make sure you put GO at
the beginning of the line. Like this:
CREATE VIEW TestView
AS SELECT au_id FROM authors
GO
CREATE VIEW TestView2
AS SELECT au_lname FROM authors
GO
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Sunday, March 25, 2012

creating user and login problem

When I try to create user using ent manager in mssql2000 it gives me error that there is already such user.But it actualy doesn't exists.

How to solve this problem?

Hi,

did you check your logins by T-SQL?

Code Snippet

SELECT CAST(loginname AS CHAR(30)) AS loginname, sid, status, denylogin

FROM master..syslogins

ORDER BY sid

|||

when you say User... i am not sure , whether u r mentioning Login or Database User. I assume that it is Database user. In that case check whether there is any database role of the same name. The user name has to be unique for both users and role.

if the below mentioned query returns row means there is some role exists in the datbase with the same name.

select *from sysusers where name='YourUserName' and issqlrole=1

Madhu

|||

Thanks for Answer

I didn't find any such role or user name in the database.

But When I connect through "sql server management tool" it lets me create the user.

but the ent manager of 2000 doesn't allow.

|||

post the exact error no and description. also check in Event log for any clue

Madhu

creating trigger on indexed view

Hi,
Is it possible to create trigger on an indexed view? I tried and it keep
give me this error:
Server: Msg 208, Level 16, State 4, Procedure Tr_TmpTrigger, Line 1
Invalid object name 'dbo.VIEW_MYVIEW'.
I also attempted to use Enterprise Manager tool to create the trigger on the
indexed view but got the same error there.
thanks!Are you trying to create an AFTER trigger (the default). Only INSTEAD OF
triggers may be created on views.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Zeng" <Zeng5000@.hotmail.com> wrote in message
news:unGrKuXkFHA.1444@.TK2MSFTNGP10.phx.gbl...
> Hi,
> Is it possible to create trigger on an indexed view? I tried and it keep
> give me this error:
> Server: Msg 208, Level 16, State 4, Procedure Tr_TmpTrigger, Line 1
> Invalid object name 'dbo.VIEW_MYVIEW'.
> I also attempted to use Enterprise Manager tool to create the trigger on
> the
> indexed view but got the same error there.
> thanks!
>sql

Thursday, March 22, 2012

creating the subscription via RMO

Hi

I'm creating an anonymous merge HTTPS subscription using RMO and vb.net 2005.

I get the following error on the mergePullSubscription.create call

+ InnerException {"'@.job_login' must be a valid Windows Login in the form : 'MACHINE\Login' or 'DOMAIN\Login'. Please see the documentation for 'sp_addmergepullsubscription_agent'.
Changed database context to 'brucesTest'."} System.Exception
What do I need to do to get this parameter set ?

I'm using the code from BOL to create it...

Thanks
BruceHi, Bruce:

You can specify the agent's properties by do the following:

subscription.SynchronizationAgentProcessSecurity.Login = winLogin;
subscription.SynchronizationAgentProcessSecurity.Password = winPassword;

For a completed reference and code snippet, please refer to this TOP in BOL.

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/repref9/html/97a232ce-7171-4124-
8c30-4a4e7f991183.htm

Thanks
Yunwensql

Tuesday, March 20, 2012

Creating Tables Dynamically

Hello!
I am looking for a simple routine to create and populate tables dynamically.
I get an error message that says @.tn has a problem. What could be the reason
:
declare @.table_name varchar(500)
declare @.query nvarchar(500)
declare @.parmdefinition nvarchar(500)
set @.query = 'create table @.tn (user_id nvarchar,event_id nvarchar)'
set @.table_name = 'test'
set @.parmdefinition = '@.tn varchar(500),@.query varchar(500)'
execute sp_executesql @.query, @.parmdefinition, @.tn = @.table_name
Any clues are very welcome. Thank you very much!
-BahmanYou need to declare @.tn.
Archer
"Bahman" wrote:

> Hello!
> I am looking for a simple routine to create and populate tables dynamicall
y.
> I get an error message that says @.tn has a problem. What could be the reas
on:
> declare @.table_name varchar(500)
> declare @.query nvarchar(500)
> declare @.parmdefinition nvarchar(500)
> set @.query = 'create table @.tn (user_id nvarchar,event_id nvarchar)'
> set @.table_name = 'test'
> set @.parmdefinition = '@.tn varchar(500),@.query varchar(500)'
> execute sp_executesql @.query, @.parmdefinition, @.tn = @.table_name
> Any clues are very welcome. Thank you very much!
> -Bahman
>|||@.tn is redundant. You can't parameterize a table name, even within
sp_executesql. Try:
declare @.table_name varchar(500)
declare @.query nvarchar(500)
declare @.parmdefinition nvarchar(500)
set @.table_name = 'test'
set @.query = 'create table '+@.table_name+' (user_id nvarchar,event_id
nvarchar)'
execute sp_executesql @.query
sp_executesql is redundant as well. You could have used EXEC.
The obvious question is why would you want to create tables
dynamically? Especially since the metadata is static in this example.
David Portas
SQL Server MVP
--|||Bagman3rd:
No, it still won't work. Does sp_executesql look for parameters only in the
where clause?
"bagman3rd" wrote:
> You need to declare @.tn.
> Archer
> "Bahman" wrote:
>|||>> I am looking for a simple routine to create and populate tables
Can you elaborate on why you want to do this? In most cases, such
requirements stem from poorly designed systems or people trying to come up
with short-cuts to avoid coding.
The solution for creating a table dynamically is to build a string the exact
CREATE TABLE script and execute it with EXEC or sp_ExecuteSQL. With
sp_ExecuteSQL you can only substitute variables not literal segments of a
DDL statement, which you seem to be doing here. So one way to write this
would be:
SET @.table_name = 'test'
SET @.parmdefinition = '( tn varchar(500),query varchar(500) )'
SET @.query = 'create table ' + @.table_name + @.parmdefinition
EXEC sp_executesql @.query
Before starting out, consider reading some implications at:
http://www.sommarskog.se/dynamic_sql.html
Anith|||Dave,
You are correct.
What I am looking for is the exact image of one particular table every hour
or so.
I am not looking for transaction logs, or sql statements, or monitor
traffic. All I want to know is what exactly is the content of the table at a
given time.
In MSSql you can backup the database or the trx log. But you cnnot create
images of individual tables that you can revert to on a moment's notice.
In this particular table, users can both add and delete records. Obviously,
they can only delete their own records. But to be safe, I need an image of
the content of the table itself, since add/delete permissions are not
'layered', e.g., once you have the right to 'delete', that right in not
strictly associated with what you entered yourself. That right is also
associated with what everyone else entered. Same with update.
There are other issues here as well. But the above are the basic stuff.
Thank you very much for your help.
-Bahman
"David Portas" wrote:

> @.tn is redundant. You can't parameterize a table name, even within
> sp_executesql. Try:
> declare @.table_name varchar(500)
> declare @.query nvarchar(500)
> declare @.parmdefinition nvarchar(500)
> set @.table_name = 'test'
> set @.query = 'create table '+@.table_name+' (user_id nvarchar,event_id
> nvarchar)'
> execute sp_executesql @.query
> sp_executesql is redundant as well. You could have used EXEC.
> The obvious question is why would you want to create tables
> dynamically? Especially since the metadata is static in this example.
> --
> David Portas
> SQL Server MVP
> --
>|||That's certainly an original one! Seriously, the problem is a common
one and there are various standard solutions. You don't need to copy
tables around dynamically. In fact it's hard to imagine how such a
thing could be practical let alone scalable.
Take a look at the following article on row-level security. More simply
you could just implement "logical" deletes - i.e. use a proc that marks
rows as deleted rather than actually deleting them.
http://vyaskn.tripod.com/ row_level...as
es.htm
David Portas
SQL Server MVP
--|||David,
That solution is pretty much what I am already doing. It is not robust thoug
h.
As you said, when you 'scale up' the database, you cannot create a separate
account for everyone who logs in to your website. So, the same account is
adding and deleting stuff from the same table all over the place. The
'session' variable that you have in the web application is not linked to the
'session' that you have on the Sequel. The two exist in two separate domains
.
Hence, the sequel does not know 'who' is 'on' right now judging from the
calling application, which is dont net.
That is just what our code is for. But some of it should be off-loaded to
the sequel side. The calling application should not be in charge of
everything.
In Windows 2003 you have a feature called 'shadow copy'. That is not the
same as tape backup. To me, it is a form of versioning. Good enough. In
sequel, you have the trx that you can apply after you recreated the database
from the backup. But there is nothing in the trx or the backup that tells yo
u
what the difference is between the state of an individual table that you see
there and the one you backed up earlier (unless you like lots of
programming). There is a 'disconnect' here.
MS Sql is basically treated as a data dump. There are cases where it has
very limited functionality. A simple trigger that I put in increases respons
e
time by a second. The server is not designed to be 'active'. And there is no
fine granule for treating data and data relationships. Hence the need to cod
e
a lot.
Thank you!
"David Portas" wrote:

> That's certainly an original one! Seriously, the problem is a common
> one and there are various standard solutions. You don't need to copy
> tables around dynamically. In fact it's hard to imagine how such a
> thing could be practical let alone scalable.
> Take a look at the following article on row-level security. More simply
> you could just implement "logical" deletes - i.e. use a proc that marks
> rows as deleted rather than actually deleting them.
> http://vyaskn.tripod.com/ row_level...as
es.htm
> --
> David Portas
> SQL Server MVP
> --
>|||>> What I am looking for is the exact image of one particular table every ho
ur or so. <<
I know of one ACCESS system that crashes so often, they do this. It
says that you need a better solution. You will have to do this in
hardware to get the exact image on a second identical disk drive.
Weird request -- most of us are happy with snapshots or generatianl
concurrency control.

Creating System DSN on Vista Box

We are trying to create System DSN on vista using the API
SQLConfigDataSource(...) it give error Access denied.
Can any one help? This is going very critical every hour.
Thanks in anticipation,
Cheers,
Madhav
Try changing the security context to administrator when
creating the DSN.
-Sue
On 16 Feb 2007 02:55:28 -0800, mlimaye@.gmail.com wrote:

>We are trying to create System DSN on vista using the API
>SQLConfigDataSource(...) it give error Access denied.
>Can any one help? This is going very critical every hour.
>Thanks in anticipation,
>Cheers,
>Madhav

Creating System DSN on Vista Box

We are trying to create System DSN on vista using the API
SQLConfigDataSource(...) it give error Access denied.
Can any one help? This is going very critical every hour.
Thanks in anticipation,
Cheers,
MadhavTry changing the security context to administrator when
creating the DSN.
-Sue
On 16 Feb 2007 02:55:28 -0800, mlimaye@.gmail.com wrote:

>We are trying to create System DSN on vista using the API
>SQLConfigDataSource(...) it give error Access denied.
>Can any one help? This is going very critical every hour.
>Thanks in anticipation,
>Cheers,
>Madhav

Sunday, March 11, 2012

Creating reports in MS SQL Server Report Server

Hi...
Need some help with creating reports in MS SQL Server Report Server and column name "Profit / Loss (%)".
Got an error when I try to run the code below.
The purpose is to avoid a division by zero... or do anyone know a better way solve this?

=IIF(SUM(Fields!RECOGNITION_REVENUE_RECOGNIZED.Value)=0 AND SUM(Fields!PROFIT_AND_LOSS_AMOUNT.Value)=0, 0, IIF(SUM(Fields!RECOGNITION_REVENUE_RECOGNIZED.Value)=0 AND SUM(Fields!PROFIT_AND_LOSS_AMOUNT.Value)<>0, -1, SUM(Fields!PROFIT_AND_LOSS_AMOUNT.Value)))
/
IIF(SUM(Fields!RECOGNITION_REVENUE_RECOGNIZED.Value)=0 AND SUM(Fields!PROFIT_AND_LOSS_AMOUNT.Value)=0, 1, IIF(SUM(Fields!RECOGNITION_REVENUE_RECOGNIZED.Value)=0 AND SUM(Fields!PROFIT_AND_LOSS_AMOUNT.Value)<>0, 1, SUM(Fields!RECOGNITION_REVENUE_RECOGNIZED.Value)))
Error message:
The value expression for the textbox ‘textbox86’ refers to the field ‘PROFIT_AND_LOSS_AMOUNT’. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.

//chwa

This error message is referring to the scope of the field ‘PROFIT_AND_LOSS_AMOUNT’. It cannot find it in the dataset. Try doing

SUM(Fields!PROFIT_AND_LOSS_AMOUNT.Value, "dataset name here")

for all those things above.

Wednesday, March 7, 2012

Creating Primary key with ODBC

Hi all,

I've spent hours trying to find the error in the following SQL 2000
command:

ALTER TABLE [ClientList] ADD CONSTRAINT [PK_ClientList] PRIMARY KEY
CLUSTERED ([PhoneNo]) On [PRIMARY]

Every time I try to "Execute" this from my (VB5) ODBC connection I get:

Runtime error 3289;
Syntax error in CONSTRAINT clause

For the life of me I can see nothing wrong. I used Enterprise manager
to create this statement, and I can create the primary key fine from
there. The PhoneNo field does not allow NULLs.

Everything is service-packed up to date. I have tried using
[databasename].[dbo].[ClientList] and suchlike.

I've tried to find a relevant manual, but my SQL Server developers
guide suggests this should be ok and I can't see anything wrong in the
books online.

Can anybody please help?

TIARS200Phil (philsowden@.dataservicesltd.co.uk) writes:
> I've spent hours trying to find the error in the following SQL 2000
> command:
> ALTER TABLE [ClientList] ADD CONSTRAINT [PK_ClientList] PRIMARY KEY
> CLUSTERED ([PhoneNo]) On [PRIMARY]
> Every time I try to "Execute" this from my (VB5) ODBC connection I get:
> Runtime error 3289;
> Syntax error in CONSTRAINT clause
> For the life of me I can see nothing wrong. I used Enterprise manager
> to create this statement, and I can create the primary key fine from
> there. The PhoneNo field does not allow NULLs.

That appears to be an error from the client layer. There certainly is
no syntax error in that statement as far as SQL Server is concerned, as
I can see. (Run in Query Analyzer to verify.)

Could you post the actual VB code you are using? Please also include
the part where you connect.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks for the prompt reply Erland.

The database is opened as follows:
..
..
..
lsConnectionString = "ODBC;Description=SQL Server 2k;DRIVER=SQL
Server;SERVER=SERVER;UID=Administrator;" & _

"APP=??;WSID=PII333;DATABASE=Sparc;Network=DBNM PNTW;QueryLog_On=Yes;
Trusted_Connection=Yes"

Set gdbSparc = DBEngine.Workspaces(0).OpenDatabase("", dbDriverNoPrompt,
False, lsConnectionString)
..
..
..

(Sorry for line confusion, hope this makes sense!).

The function that would build the indexes contains the following code.

lsSQL = "ALTER TABLE " & lsTable & " " & _
"ADD CONSTRAINT PK_" & lsTable & " PRIMARY KEY CLUSTERED " & _
"([PhoneNo]) On [PRIMARY];"

gdbSparc.Execute lsSQL

This translates to the code I posted previously when the "lsTable"
parameter is provided (e.g. [ClientTable]).

I pasted the code by printing the value of <lsSQL> in the debug window
and copying it from there.

HTH

Phil

*** Sent via Developersdex http://www.developersdex.com ***|||RS200Phil (RS200Phil@.dataservicesltdnospam.co.uk) writes:
> The database is opened as follows:
> .
> .
> .
> lsConnectionString = "ODBC;Description=SQL Server 2k;DRIVER=SQL
> Server;SERVER=SERVER;UID=Administrator;" & _
> "APP=??;WSID=PII333;DATABASE=Sparc;Network=DBNM PNTW;QueryLog_On=Yes;
> Trusted_Connection=Yes"
> Set gdbSparc = DBEngine.Workspaces(0).OpenDatabase("", dbDriverNoPrompt,
> False, lsConnectionString)
> .
> .
> (Sorry for line confusion, hope this makes sense!).
> The function that would build the indexes contains the following code.
> lsSQL = "ALTER TABLE " & lsTable & " " & _
> "ADD CONSTRAINT PK_" & lsTable & " PRIMARY KEY CLUSTERED " & _
> "([PhoneNo]) On [PRIMARY];"
> gdbSparc.Execute lsSQL

Hm, doesn't look like modern technology to me. :-)

Have you checked which version of the ODBC SQL Server driver you have?
Which operating system is this (incl Service Pack)? Do you know which
version of the MDAC you have?

All I can really recommend is to try to get a newer version of the ODBC
driver, as this appeears to be culprit. (You could try to remove the
"On [PRIMARY]" part.)

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||RS200Phil wrote:
> gdbSparc.Execute lsSQL

Try:
gdbSparc.Execute lsSQL, dbSQLPassthrough

Otherwise Jet sticks its nose in.|||Thanks for that, Trevor.

The passthrough was originally in place, but it failed with error 3416.
I thought I was getting more info when I went through Jet.

However, you've hit the nail on the thumb! I found the following in the
Jet manual:

"Note The Microsoft Jet database engine doesn't support the use of
CONSTRAINT, or any of the data definition language (DDL) statements,
with non-Microsoft Jet databases. Use the DAO Create methods instead."

So it's back to the drawing board, then!

BTW - I am converting about 100 quite large tables from a legacy Access
97 back end to SQL 2k. DTS doesn't do a brilliant job of the
conversion, but it did create the initial vb5 code for me. I just had
to bodge it for the index creation (no good there, then!) and to change
some of the field types (rather than do it manually for about 1000
fields!).

Thanks for your help, I'm optimistic that I can resolve it now.

Cheers

Phil

*** Sent via Developersdex http://www.developersdex.com ***|||RS200Phil wrote:
> Thanks for that, Trevor.
> The passthrough was originally in place, but it failed with error 3416.
> I thought I was getting more info when I went through Jet.

You mean 3146? You can loop the errors collection of the dbengine
object, e.g.

dim e as Error
...
For each e in DbEngine.Errors
debug.print e.number, e.description
Next

> BTW - I am converting about 100 quite large tables from a legacy Access
> 97 back end to SQL 2k. DTS doesn't do a brilliant job of the
> conversion, but it did create the initial vb5 code for me. I just had
> to bodge it for the index creation (no good there, then!) and to change
> some of the field types (rather than do it manually for about 1000
> fields!).

Have you tried the upsizing wizard? http://support.microsoft.com/kb/q176614/|||Thanks so much for the ideas. Of course - I should've thought of the
dbengine error collection.

Also, I like the idea of the upsizing wizard. I've used it before, some
time ago, but opted for the SQL Server DTS tool. I'll give this a go,
too.

I appreciate all your help, Trevor. I'm sure I'll be ok now.

Cheers

Phil

*** Sent via Developersdex http://www.developersdex.com ***

Creating new user

Whats the error message?

>--Original Message--
>Hello all,
>I have downloaded the evaluation version to Sql Server
2000. I have a front
>end database that is Access 2000 attached to the SQL
server 2000. What do I
>need to do to get another user to be able to get into the
database?
>I have gone into the sql server and added another
database user and gave him
>database role membership as public and granted him
permissions to all
>tables, but he still cannot get in. What am I missing?
(I am brand new to
>all of this!)
>Thanks,
>Gale
>
>.
>
I think I have figured it out now.
I am just having problems linking tables now. In Access 2000, once you
linked the front end of the database you could copy it to another work
station and it would be automatically linked to the backend. I don't think
it works that way when you link a front end with the SQL server. I have
mine on my work station successfully linked and I can get into it. I copied
the front end onto another work station and the linking didn't work. I had
to link it all over again. When I link the tables they always end up with a
name like dbo.Agency. All the reports and forms in the front end of the
database are looking for a table named "Agency". So I have to go in and
change the names of the tables in the front end and take all the "dbo" off
of them. Then the forms and reports work.
Is there a way around this? Can you copy a front end and paste it on
another machine and should it still be linked? How can I get the "dbo" off
the front of all my tables when I link them?
Goodness for all the questions, but I am just starting and prefer to play
around and get to know the lingo a little before I delve into a book.
Thanks,
Gale
|||OK, figured out that problem to. I needed to set up a user DNS on the
machine and then copy the access front end over and it worked!
Gale

Saturday, February 25, 2012

Creating new Notificatio services instance

When I try to create new Notification services instance, I am getting the following error message.

"Notification services failed to open a connection to sql server".

I have changed default connections to remote.But still I am getting same error.Please help me I am new to Notification services.

Can you elaborate a bit? Anything in the windows event log? Are you an administrator on the SQL Server? Does your SQL Server instance allow remote connections?

Joe

Creating new Notificatio services instance

When I try to create new Notification services instance, I am getting the following error message.

"Notification services failed to open a connection to sql server".

I have changed default connections to remote.But still I am getting same error.Please help me I am new to Notification services.

Can you elaborate a bit? Anything in the windows event log? Are you an administrator on the SQL Server? Does your SQL Server instance allow remote connections?

Joe

Creating New DB using SMO

Hi,
I am trying to create a new database using SMO, I am getting Set_Parent
Failure Error when try to create a new database.
This is the code I am using to create the database.

Database database= new Database(DbServer, "MyNewDB");
database.Create();
I know that if you just use the first line it will try to attach the database, and u will get set_parent failure error, but I am using .Create() also.... still I am getting the error.... can anyone help me in this ?
Thanks
Rujith

If above is the code you are using, I would think you would get a compile error. The Database Constructor overload that takes 2 parameters is the following:

Database(Server server, string name);

where you must give it a server object where the new database will reside.

Here is some sample code that works:

Server server = new Server(".");
Database db = new Database(server,"MyDatabaseName");
db.Create();

I have a few SMO tutorials that I have been slowly writing that may be of help:

SQL Server Management Objects (SMO) Tutorials

Regards,

Dave

|||

Dave,

Sorry for the wrong code, I removed the first line(creating server), while putting in the forum. Thats the reason for the syntax error. In my actual code, I am creating server first, then calling the database constructor.

Did you ever get the Set_parent failure error while working with SMO?

-Rujith

|||

You can create that error a couple of ways:

Database db = new Database(null,"MyDatabaseName");
db.Create();

or

Database db = new Database();
db.Parent = null;

Either way, if you pass in null for the server (parent) you will get the error:

SetParent failed for Database 'MyDatabaseName'.

Change your code to see if server is null before passing it into the constructor.

Regards,

Dave

Sunday, February 19, 2012

Creating index - Error 229 (Permission denied)

I have been working with my DBA and have not yet found the issue.
I have my development database on a SQL Server 2005 server. I enabled
it for full-text catalogs and created a catalog with no issues
whatsoever. When I go to create the index, however, I run through the
wizard (using SMS) until the last step. Upon finishing the wizard, I
get the following error:
Failed to retrieve data for this request (Microsoft.SqlServer.SmoEnum)
Additional Information:
A exception occurred while executing a Transact-SQL statement or
batch. (Microsoft.SqlServer.ConnectionInfo)
EXECUTE permission denied on object 'sp_help_category', database
'msdb', schema 'dbo'.
SELECT permission denied on object 'sysjobs_view', database 'msdb',
schema 'dbo'. (Microsoft SQL Server, Error: 229).
I am the dbowner, and the DBA granted me temporary DBA privileges with
no difference (still received the same error). The DBA created the
index for me with no problems. I can see the index (I have not yet
tried using it). I can pull up the property pages and see "General"
and "Columns" views fine, but when I click on "Schedules", I receive
the same error as above.
Any thoughts?
Thanks.
You will need to be in the dbo_role on the msdb database as well.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<tlchurch@.gmail.com> wrote in message
news:1170424716.096179.254400@.l53g2000cwa.googlegr oups.com...
>I have been working with my DBA and have not yet found the issue.
> I have my development database on a SQL Server 2005 server. I enabled
> it for full-text catalogs and created a catalog with no issues
> whatsoever. When I go to create the index, however, I run through the
> wizard (using SMS) until the last step. Upon finishing the wizard, I
> get the following error:
> Failed to retrieve data for this request (Microsoft.SqlServer.SmoEnum)
> Additional Information:
> A exception occurred while executing a Transact-SQL statement or
> batch. (Microsoft.SqlServer.ConnectionInfo)
> EXECUTE permission denied on object 'sp_help_category', database
> 'msdb', schema 'dbo'.
> SELECT permission denied on object 'sysjobs_view', database 'msdb',
> schema 'dbo'. (Microsoft SQL Server, Error: 229).
> I am the dbowner, and the DBA granted me temporary DBA privileges with
> no difference (still received the same error). The DBA created the
> index for me with no problems. I can see the index (I have not yet
> tried using it). I can pull up the property pages and see "General"
> and "Columns" views fine, but when I click on "Schedules", I receive
> the same error as above.
> Any thoughts?
> Thanks.
>
|||Hello tlchurch,
I am surprised your DBA hasn't ben able to help, as the error is fairly self
explanatory.
You do not have permissions to access sysjobs_view in database msdb and also
execute sp_help_category in msdb.
Your DBA needs to give you the correct permissions to see the schedules,
which are store in msdb.
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons

> I have been working with my DBA and have not yet found the issue.
> I have my development database on a SQL Server 2005 server. I enabled
> it for full-text catalogs and created a catalog with no issues
> whatsoever. When I go to create the index, however, I run through the
> wizard (using SMS) until the last step. Upon finishing the wizard, I
> get the following error:
> Failed to retrieve data for this request (Microsoft.SqlServer.SmoEnum)
> Additional Information:
> A exception occurred while executing a Transact-SQL statement or
> batch. (Microsoft.SqlServer.ConnectionInfo)
> EXECUTE permission denied on object 'sp_help_category', database
> 'msdb', schema 'dbo'.
> SELECT permission denied on object 'sysjobs_view', database 'msdb',
> schema 'dbo'. (Microsoft SQL Server, Error: 229).
> I am the dbowner, and the DBA granted me temporary DBA privileges with
> no difference (still received the same error). The DBA created the
> index for me with no problems. I can see the index (I have not yet
> tried using it). I can pull up the property pages and see "General"
> and "Columns" views fine, but when I click on "Schedules", I receive
> the same error as above.
> Any thoughts?
> Thanks.
>