Syntax Error While Implementing Forms Auth

Aug 9, 2007

Hi All:

Need quick help guyz. I am implementing Forms Authentication on my website below is the code for the same... However  I am getting the following error ....

Line 1: Incorrect syntax near 'SQLSTR'. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader() at GreyHounds.Login.btnLogin_Click(Object sender, EventArgs e) in c:inetpubwwwrootGreyHoundsLogin.aspx.vb:line 49  Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click

Dim con As New SqlConnection("server=localhost; initial catalog=Grey Hounds; integrated security=SSPI")Dim SQLSTR As String = "Select * from Emp_Login"

Dim cmd As New SqlCommand("SQLSTR", con)Dim p1 As New SqlParameter("@EmpId", SqlDbType.VarChar)Dim p2 As New SqlParameter("@Password", SqlDbType.VarChar)

p1.SqlDbType = SqlDbType.VarChar

p1.Value = txtEmpID.Text

p2.SqlDbType = SqlDbType.VarChar

p2.Value = txtPass.Text

cmd.CommandType = CommandType.Text

cmd.Parameters.Add(p1)

cmd.Parameters.Add(p2)

Try

con.Open()Dim dr As SqlDataReader = cmd.ExecuteReader()

If Not txtEmpID.Text.Equals("") Or txtPass.Text.Equals("") Then

If dr.Item("Emp_Login") = p1.Value And dr.Item("Password") = p2.Value ThenFormsAuthentication.RedirectFromLoginPage(txtEmpID.Text, True)

Response.Redirect("http://localhost/greyhounds/Default.aspx")

Session("Emp_ID") = p1.Value

End If

Else

lblMessage.Text = "Invalid Credentials!Please try again"

End If

lblMessage.Text = "Cannot leave the boxes empty! Please enter the values"Catch ex As SqlException

Response.Write("<b>" & ex.Message & ex.HelpLink & "</b>")

Response.Write(ex.StackTrace)Catch ex1 As Exception

Response.Write(ex1.Message & ex1.Source & ex1.HelpLink)

Finally

con.Close()End Try

End Sub

 

Your quick help is highly appreciated...

Thanks!

Brandy

View 2 Replies


ADVERTISEMENT

Reporting Services 2000 W/ Forms Auth - Rs.Timeout Not Getting Set

Feb 23, 2007

I have implemented the Forms Authentication in Reporting Services 2000. In addition, we have a reports web application that uses the authentication to access the reports in the Reports Server. I have implemented a similar code that is posted in http://msdn2.microsoft.com/en-us/library/aa902691(SQL.80).aspxhttp://msdn2.microsoft.com/en-us/library/aa902691(SQL.80).aspx for the Reports Server and Reports Manager. For the web application, I added reference to the custom security assembly, created a new ReportsServerProxy, and then called the LogonUser().

Now, one of the functionality we have in the applicaiton is to set the reporting services Timeout for reports that take too long to run. The weird thing is the Timeout (in milliseconds) is getting ignored by the ReportServerProxy using the custom security assembly. I verified that without the custom secuirty assembly, the Timeout property is getting set.

I did find the code for ReportServerProxy's GetWebRequest(Uri uri) is setting the request.Timeout to -1. I thought this was interfering with the rs.Timeout, but removing the code did not make any difference.

How do I set the Timeout property correctly? Do you know of any issues with setting the Timeout property for Reporting Services with Forms Authentication?

Can anybody help PLEASE? I need an answer ASAP. Thanks in advance for your help.

/**partial UILogon.aspx code for ReportServerProxy below**/

public class ReportServerProxy : ReportingService

{

protected override WebRequest GetWebRequest(Uri uri)

{

HttpWebRequest request;

request = (HttpWebRequest)HttpWebRequest.Create(uri);

// Create a cookie jar to hold the request cookie

CookieContainer cookieJar = new CookieContainer();

request.CookieContainer = cookieJar;

Cookie authCookie = AuthCookie;

// if the client already has an auth cookie

// place it in the request's cookie container

if (authCookie != null)

request.CookieContainer.Add(authCookie);

request.Timeout = -1;

request.Headers.Add("Accept-Language",

HttpContext.Current.Request.Headers["Accept-Language"]);

return request;

} ...}

/** Below is the Reports Web applicaiton code that calls the ReportsServerProxy LogonUser **/

Public Function GetReportServerProxy() As ReportServerProxy

Dim rsProx As New ReportServerProxy

rsProx.Url = ConfigurationSettings.AppSettings("REPORT_SERVER_URL") + "/ReportService.asmx"

Try

rsProx.LogonUser("SYSADMIN", "password", Nothing)

Return rsProx

Catch ex As Exception

Throw New Exception("GetReportServerProxy Failed.", ex)

End Try

End Function



Private Function CreateSnapShot() As String

...

Dim rs As RSCustomSecurity.ReportServerProxy

Try



rs = GetReportServerProxy()

' First set the parameters' default values

parameters = setParamters()

rs.SetReportParameters(reportPath, parameters)

If errorsList.Count > 0 Then Throw New Exception

'Server.ScriptTimeout = 10

rs.Timeout = Integer.Parse(ConfigurationSettings.AppSettings.Get("REPORT_PROCESS_TIMEOUT"))

lsHistoryID = rs.CreateReportHistorySnapshot(reportPath, warnings)

'lblStatus.NavigateUrl = "ViewSnapShot.aspx?History_ID=" & lsHistoryID

lblStatus.Text = "Your request has been processed. View report as"

....

Catch ex As Exception

....

Finally

Debug.Write("End : " & Now.ToLongTimeString)

rs = Nothing

End Try

End Function

View 1 Replies View Related

Longhorn Server, WSSv3, SQL Express 2005 And Forms Auth Setup Issue

Jun 6, 2007

I seem to be having a strange problem with accessing the SQL Express database under the following configuration.



Install Longhorn Server Beta 2
Add WSS role, setup default site, everything seems to be working fine (using NTLM auth for the site). Content database clearly working fine to the embedded SQL Server Express.
Want to switch to Forms Based Authentication with SQL Membership Provider. Follow insructions for it and discover the following issues accessing the database:

aspnet_regsql (running locally on same box) fails and says it can't connect to the database
try using the surface area configuration tools to enable remote access/ protocols etc.
aspnet_regsql still fails and says it can't connect to the database
Install the SQL Management Studio Express - try connecting it to the databse to explore the tables etc.
SQL Management Studio Express fails to connect to the database
Try switching client config to connect via shared memory rather than over TCP/IP etc.
Still fails to connect to database
Try install a third party tool called MSSQL Maestro (does some similar things to SQL Management Express)
Lo and behold - MSSQL Maestro connects to the database just fine, can explore the tables etc. No problems.
Try aspnet_regsql again, try SQL management express again after doing lots of things (try restarts etc. restarts of services). No luck.

So I'm confused. WSS seems to connect to the SQL Express config database fine. MSSQL Maestro connects to the database fine and will allow me to explore it. Using the exact same host and database name (the WSS configured default) aspnet_regsql and SQL Management Studio express both fail with the exact same error.



EDIT: Some significant additional details:

- I have two databases .MICROSOFT#SSEE (which is the WSS default internal database) and .SQLEXPRESS (installed when I installed the rest of SQL Express to get the management tools etc.)

- I can connect to them both by command line with sqlcmd -S.MICROSOFT#SSEE and sqlcmd -S.SQLEXPRESS just fine. They're both running.

- I CAN connect to.SQLEXPRESS from SQL Management Express Studio, but I cannot connect to .MICROSOFT#SSEE

- A look at the error log, shows a line like the following about listening on the named pipe for SQLEXPRESS database, but I don't see a similar entry for the MICROSOFT#SSEE (even thought it's configured to do so in configuration manager...)

"Server local connection provider is ready to accept connection on [ \.pipeSQLLocalSQLEXPRESS ]."

- I've run SQL Management Express as administrator - no change

- The error I get is either error 26, or error 40 when using Shared Memory protocol

- I get the same error and error code from aspnet_regsql



Any suggestions? I'm stumped...

View 1 Replies View Related

RS 2000, Forms Authentication, Argument Exception Adding Auth Cookie To The Web Request For Graph

Jan 16, 2007

Hello, I have run into a strange problem with RS 2000. I have a base class that will call a reporting server web service, render a report to pdf, then write the report output to the stream. This has worked fine for me for reports.

However, when I render a graph to pdf, I get the following exception:

[ArgumentException: cookie.Domain]

System.Net.CookieContainer.Add(Cookie cookie) +583
Learning.Common.Reporting.ReportServerProxy.GetWebRequest(Uri uri)

...

I only get this exception in our staging environment, not locally.

Here is a code snippet from the ReportServerProxy class, but it is pretty textbook according to the MSDN samples..

public class ReportServerProxy : ReportingService {
protected override WebRequest GetWebRequest(Uri uri) {
HttpWebRequest request;
request = (HttpWebRequest)HttpWebRequest.Create(uri);
// Create a cookie jar to hold the request cookie
CookieContainer cookieJar = new CookieContainer();
request.CookieContainer = cookieJar;
Cookie authCookie = AuthCookie;
// if the client already has an auth cookie
// place it in the request's cookie container
if (authCookie != null){
request.CookieContainer.Add(authCookie);
}
...

}


As I said, I can run reports one after another without issue, graphs are causing me problems.

View 1 Replies View Related

How To Change Windows Auth. To SQL Server Auth. In SSIS Packages

Apr 30, 2007

I had a few packages created with Windows Authentication which now needs to be migrated to run with SQL Server Authentication. I tried changing it in the connection managers but the packages failed to validate at the SCD transformations.For a few packages I had Configuration files for these packages where i tried to do it but it dint run giving the following Error Message:
[Connection manager "Target"] Error: An OLE DB error has occurred. Error code: 0x80040E4D. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E4D Description: "Login failed for user <<with my network id>>.".

[Execute SQL Task] Error: Failed to acquire connection "Target". Connection may not be configured correctly or you may not have the right permissions on this connection.

Target was the name of my connection.

View 1 Replies View Related

Weird SQL Auth Error

Jun 20, 2006

hey all, i have a weird authentication error.i have two servers, both running sql server 2005. one is on my workstation the other is on my dev server. i backed up my workstation database and restored it on the dev server. my workstation is xp and my server win2k3. i'm developing an asp.net 2.0 app that talks to my sql server using windows auth. on my workstation my website runs under the ASPNET account, IUSER_COMPUTERNAME and i had that account setup in sql on my workstation in the main security folder, then again in the db security folder the name of it was [ASPNET LOGIN]. each sproc had EXEC permission for [ASPNET LOGIN].when i restored it over to my win2k3 box i deleted that login from the database and revoked it on all the sprocs. i then setup another account for the application and set my website to use that account. i couldn't use the original account because of the group it was in, blah blah blah, not important.  the thing is, i got rid of all instances of that ASPNET LOGIN account and i'm running the website under a new account, and some of the stored procedures work, but some of them i get the error "Cannot find the user 'ASPNET LOGIN', because it does not exist or you do not have permission." which is crazy, because i've gotten rid of all references to that. it's not anywhere i see in the database, not in either security/users folder, it's not on any of the stored procedures. and it's NOWHERE in the website. not in IIS or code. furthermore some of the stored procedures work. as far as i can tell, the ones that are not called from my custom MemberShipProvider are working. so i went back to my database on my workstation, revoked exec permission on the sprocs, deleted the login from the db and then from the sql server instance, backed it up again, restored on my server and i'm still getting this issue.where can that ASPNET LOGIN be hiding? i restarted too thinking maybe it was cached somewhere. this is my connection string that the entire app uses: "Server=[serverName]; Database=[dbName]; Trusted_Connection=true;"my web.config is using <identity impersonate="true"/> and my website is running under the account i created.any ideas? i've been battling this for half a day.and why would it only happen with the membership provider? it's using the same connection string the rest of the app is.

View 3 Replies View Related

SQL7/SQL2000 Replication. Auth Error

Aug 12, 2002

I'm attemting to replicate from a SQL7 box to SQL2000.

The snapshot works fine, but it fails when it tries to push the subscription to the SQL2000 box with a trust error (I don't recall the exact message). I noticed that it fails when Enterprise Mgr is configured as: "Tools/Replication/Configure Publishing, Subscribers and Distribution", Subscriber Tab, "Impersonating SQL Service Agent". It works if I change to "SA".

This is only the case when we replicate from SQL7 to SQL2K. SQL7 to SQL7 works fine with "Impersonating". Has anybody seen this behavior? Any workarounds, other than using SA?

View 2 Replies View Related

SQL7/SQL2000 Replication. Auth Error

Aug 12, 2002

I'm attemting to replicate from a SQL7 box to SQL2000.

The snapshot works fine, but it fails when it tries to push the subscription to the SQL2000 box with a trust error (I don't recall the exact message). I noticed that it fails when Enterprise Mgr is configured as: "Tools/Replication/Configure Publishing, Subscribers and Distribution", Subscriber Tab, "Impersonating SQL Service Agent". It works if I change to "SA".

This is only the case when we replicate from SQL7 to SQL2K. SQL7 to SQL7 works fine with "Impersonating". Has anybody seen this behavior? Any workarounds, other than using SA?

View 1 Replies View Related

Clean Install Windows Auth Error

Feb 17, 2007

Hi,

I cannot log in to SQL Server 2005 Dev Edition in my local machine using Windows Authentication. The server returned "Login failed..." when connecting with SQL Server Management Studio.

I have not change anything since installation of this server.

This problem happens in RTM and SP1 versions, both running on Windows Vista RTM.

Anyone having this kind of problem too? Any solution? I'm guessing it's Vista-related.

View 1 Replies View Related

Connecting To SQL Server 2005 Using Windows Auth/Cannot Generate SSPI Context Error

Jan 3, 2008

Hi-I have a program that I am developing on a laptop, then deploying it on a server.I have the prgram running passing a username and PW in the connection object, but like the idea of using windows authentication MUCH better.I just joined the domain, so I am domain/me for example.If I log into the server, and look at securities, logins and added domain/me to the logins.I then try and set up a sql connection via both visual studio, and sql server magt studio, and get the dreaded "Cannot generate SSPI context" error. Anyone else have this problem? SHOULD V.S. be using domain/me to connect?  TIA dan 

View 6 Replies View Related

Autogrow Of File 'FORMS' In Database 'FORMS' Cancelled Or Timed Out After 30547 Ms.

Jun 26, 2007

Afternoon

I'm getting the below error message:

Autogrow of file 'FORMS' in database 'FORMS' cancelled or timed out after 30547 ms. Use ALTER DATABASE to set a smaller FILEGROWTH or to set a new size.

FORMS.LDF file is 7613952 KBand the growth is 512MB .

By how much should I set the filegrowth? The users are complaining that the application is freezing on them.

This is sqlserver 2000.

View 6 Replies View Related

Get Error Implementing Linked Servers

Apr 29, 2008

Hi Everyone.

I am trying to setup a linked server on 2 machines. Both machines have identical SA login/pwd. Also, both machines have a database called Federated_Bridge.

The setup I have is as follows:

Machine 1: (local) - As it appears in Enterprise Manager
Machine 2: (RealIBM2) - As it appears in Enterprise Manager

Earlier I executed a query to successfully link machine 1 to machine 2 as follows:

-------

EXEC master.dbo.sp_addlinkedserver @server = 'TEST3', @srvproduct = 'SQLServer OLEDB Provider',@provider='SQLOLEDB', @datasrc='REALIBM2', @catalog='Federated_Bridge'

EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname='TEST3',@useself='False',@locallogin=NULL,@rmtuser='sa',@rmtpassword='mysapwd'

-----

The above query works. However, when I try to do the same thing from Machine 2, it's not working. It doesn't seem to like the (local) name for the @datasrc field. Here is my new query .. which is failing:


-----

EXEC master.dbo.sp_addlinkedserver @server = 'TEST2', @srvproduct = 'SQLServer OLEDB Provider',@provider='SQLOLEDB', @datasrc='local', @catalog='Federated_Bridge'

EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname='TEST2',@useself='False',@locallogin=NULL,@rmtuser='sa',@rmtpassword='mysapwd'

----


The question I have is, how do I reference the SQL instance that is saying (local) ?

Thanks!



View 1 Replies View Related

SSRS Forms Authentication Error:An Error Occurred While Attempting To Get The ReportServer Url. The RPC Server Is Unavailable. (

Apr 3, 2008

I have managed to get the Forms Authentication sample to work bu there is a hitch. I am running Report Server and Report Manager on the same(test) PC. I can logon to the Report Server without a problem but when I try logon from the UILogon.aspx page for Report Manager I receive the following error:

An error occurred while attempting to get the ReportServer Url. The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
An error occurred while attempting to get the ReportServer Url. The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)An error occured while attempting to get the ReportServer Url. The RPC server is unavailable.(Exception from HRESULT: 0x800706BA).

I can register users which suggests that the page can connect to the database.

Any help???

View 3 Replies View Related

IE7 Script Error When Opening Infopath Forms

Jan 31, 2007

Hi,

I installed IE7 recently and it is giving me problems when I open Infopath forms to edit documents. I have a sharepoint website which contain links to these forms, when I click on the link it opens the infopath form. It was working absolutely fine when I used IE6. But now when I open the infopath form it gives me an error saying that

A Runtime error has occured

Line: 38

Error: Object Expected



When I open it in the debugger it shows me an error at <body onLoad="onLoad()">. Could someone please advice!



I appreciate a quick response.



Thanks

View 2 Replies View Related

Error When Deploying Forms Authentication Sample

Feb 20, 2007

Hello

I'm trying to get the forms authentication sample working - I have followed the instructions given in the ReadMe that came with the samples. When I try to browse to localhost/reportserver (on the server), instead of seeing the logon page as expected, I get the following error message:



An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I built the sample in VS 2005, and am using v2 of .net. Reporting services is installed on a windows server 2003 machine.

This has been driving me crazy for a while now. Any help would be greatly appreciated!

Thanks in advance

Dominic

View 4 Replies View Related

Implementing Transaction In SSIS Package - [Execute SQL Task] Error: Failed To Acquire Connection &&<ConnectionName&&>.

Jun 30, 2006

I have a simple SSIS package with three "Execute SQL Tasks". I am using ADO.Net Connection to execute SPs on a DB server.

When I execute this package It works fine. So far so good.

Now, I need to implement transation on this package. And problem starts now onwards. When I try to execute package after setting TransationOption = Required for the Sequence container which contains all the tasks, I get following error.

[Execute SQL Task] Error: Failed to acquire connection "NYCDB0008.Export". Connection may not be configured correctly or you may not have the right permissions on this connection.

"NYCDB0008.Export" is the name of the ADO.Net connection. I have been hunting for any solution but all in vain. I have tried changing all DTC settings on the dev as well as Database server.

Please respond if anyone has any solution.

Thanks!

Anand

View 24 Replies View Related

(Urgent)Login Error While Integrating Reporting Services With ASP.NET Using Forms Authentication

Apr 17, 2008



Hi all,
I am using forms authetication to log in to reporting services. I am using logonuser method of reporting services web service. I am getting the following error when i try to log in

System.Web.Services.Protocols.SoapException: Server was unable to process request. --->
System.Exception: An error occurred while attempting to verify the user.Login failed for user 'SON-1499IUSR_SON-1499'.
at Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationUtilities.VerifyPassword(String suppliedUserName, String suppliedPassword)
at Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension.LogonUser(String userName, String password, String authority)
at Microsoft.ReportingServices.WebServer.RSCustomAuthentication.LogonUser(String userName, String password, String authority)
at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.LogonUser(String userName, String password, String authority)
at Microsoft.ReportingServices.WebServer.ReportingService2005.LogonUser(String userName, String password, String authority) --- End of inner exception stack trace ---

I have LocalMachine/ASPNET web service identity set in Reporting Services Configuration on Windows XP .

Thanks in advance.
Anupama

View 6 Replies View Related

ERROR:Syntax Error Converting Datetime From Character String. With Stored Procedure

Jul 12, 2007

Hi All,





i have migrated a DTS package wherein it consists of SQL task.

this has been migrated succesfully. but when i execute the package, i am getting the error with Excute SQL task which consists of Store Procedure excution.



But the SP can executed in the client server. can any body help in this regard.





Thanks in advance,

Anand

View 4 Replies View Related

Getting Server Error Syntax Error Converting The Nvarchar Value 'Sonoma' To A Column Of Data Type Int.

Apr 20, 2007

Hi, all
I'm getting this error at runtime when my page tries to populate a datagrid. Here's the relevant code.
First, the user selects his choice from a dropdownlist, populated with a sqldatasource control on the aspx side:<asp:SqlDataSource ID="sqlDataSourceCompany" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [PayrollCompanyID], [DisplayName] FROM [rsrc_PayrollCompany] ORDER BY [DisplayName]">
</asp:SqlDataSource>
 And the dropdown list's code:<asp:DropDownList ID="ddlPayrollCompany" runat="server" AutoPostBack="True" DataSourceID="sqlDataSourcePayrollCompany"
DataTextField="DisplayName" DataValueField="PayrollCompanyID">
</asp:DropDownList>
Then, I use the selectedindexchanged event to bind the data to the datagrid. Here's that code:
 1 Sub BindData()
2
3 Dim ds As New DataSet
4 Dim sda As SqlClient.SqlDataAdapter
5 Dim strSQL As String
6 Dim strCon As String
7
8 strSQL = "SELECT [SocialSecurityNumber], [Prefix], [FirstName], [LastName], [HireDate], [PayrollCostPercent], " & _
9 "[Phone], [BadgeNumber], [IsSupervisor], [SupervisorID], [IsUser], [IsScout] FROM [rsrc_Personnel] " & _
10 "WHERE ([PayrollCompanyID] = @PayrollCompanyID)"
11
12 strCon = "Data Source=DATASOURCE;Initial Catalog=DATABASE;User ID=USERID;Password=PASSWORD"
13
14 sda = New SqlClient.SqlDataAdapter(strSQL, strCon)
15
16 sda.SelectCommand.Parameters.Add(New SqlClient.SqlParameter("@PayrollCompanyID", Me.ddlPayrollCompany.SelectedItem.ToString()))
17
18 sda.Fill(ds, "rsrc_Personnel")
19
20 dgPersonnel.DataSource = ds.Tables("rsrc_Personnel")
21 dgPersonnel.DataBind()
22
23 End Sub
24

 
I'm assuming my problem lies in line 16 of the above code. I've tried SelectedItemIndex, SelectedItemValue too and get errors for those, as well.
What am I missing?
Thanks for anyone's help!
Cappela07

View 2 Replies View Related

Execute SQL Task: Executing The Query Exec (?) Failed With The Following Error: Syntax Error Or Access Violation. Possible F

Jan 23, 2008

Hi,
I'm having an SSIS package which gives the following error when executed :

Error: 0xC002F210 at Create Linked Server, Execute SQL Task: Executing the query "exec (?)" failed with the following error: "Syntax error or access violation". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.Task failed: Create Linked Server

The package has a single Execute SQL task with the properties listed below :

General Properties
Result Set : None

ConnectionType : OLEDB
Connection : Connected to a Local Database (DB1)
SQLSourceType : Direct Input
SQL Statement : exec(?)
IsQueryStorePro : False
BypassPrepare : False

Parameter Mapping Properties

variableName Direction DataType ParameterName

User::AddLinkSql Input Varchar 0


'AddLinkSql' is a global variable of package scope of type string with the value
Exec sp_AddLinkedServer 'Srv1','','SQLOLEDB.1',@DataSrc='localhost',@catalog ='DB1'

When I try to execute the Query task, it fails with the above error. Also, the above the sql statement cannot be parsed and gives error "The query failed to parse. Syntax or access violation"

I would like to add that the above package was migrated from DTS, where it runs without any error, eventhough
it gives the same parse error message.

I would appreciate if anybody can help me out of this issue by suggeting where the problem is.

Thanks in Advance.

View 12 Replies View Related

Error 241: Syntax Error Converting Datetime From Character String

Jan 7, 2004

Hi All, can someone help me,
i've created a stored procedure to make a report by calling it from a website.
I get the message error "241: Syntax error converting datetime from character string" all the time, i tryed some converting things but nothig works, probably it is me that isn't working but i hope someone can help me.
The code i use is:


CREATE proc CP_Cashbox @mID varchar,@startdate datetime,@enddate datetime
as
set dateformat dmy
go
declare @startdate as varchar
declare @enddate as varchar

--print "query aan het uitvoeren"

select sum(moneyout) / sum(moneyin)*100 as cashbox
from dbo.total
where machineID = '@mID' and njdate between '@startdate' and '@enddate'
GO



Thanx in front
Cya

View 14 Replies View Related

Snapshot Agent Gives Error: Line38: Syntax Error Near 'tabl'

Oct 1, 2005

Hi all,

View 4 Replies View Related

Web Access / NT Auth

Apr 15, 2002

Can someone tell me how I would set up a web front end to use NT authentication? I know that I would use a IUSER Account. However how does the web actually use that account? Once i have a NT account created how do i configure it on the web server..

Your assistance is appreciated,
David

View 1 Replies View Related

Windows Auth Or Sql..

Oct 14, 2006

When creating connections for source and destination in a package what is the recommended approach, window authenticatation or sql? I will be deploying to filesystem, what would be best.

this is my first ssis package, so pardon my ignorance.



many thanks.

kushpaw

View 4 Replies View Related

Alter Table Syntax Error - Anyone Sees The Error?

Nov 24, 2004

Hello,

the following alter table statement:

ALTER TABLE [dbo].[CalCalendar]
ALTER COLUMN [OID] uniqueidentifier NOT NULL PRIMARY KEY NONCLUSTERED

is answered with:

Server: Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'PRIMARY'.

which I consider to be interesting. Anyone has an idea why? I checked documentation but I do not see an error.

Note that:

ALTER TABLE [dbo].[CalCalendar]
ALTER COLUMN [OID] uniqueidentifier NOT NULL

DOES get executed, and

ALTER TABLE [dbo].[CalCalendar]
ALTER COLUMN [OID] uniqueidentifier NOT NULL PRIMARY KEY

produces the same error.

Now, in my understanding this has nothing to do with an index may already exist etc. - the eror indicates a SYNTAX error, before any checking. Makes no sense to me, though, reading the documentation.

So - anyone an idea?

View 4 Replies View Related

Integrated Auth And SQL Servers

Apr 4, 2005

I'm building a reporting server that will grab data off of a an old HP3000, all of that is being done in a background task (non asp.net) and uploaded to an sql server.
I'm using a web interface to allow people within the company to view the data.  This will be in a single domain, behind a firewall, and will not be accessable from outside of the company.
In IIS, I have anonymous login unchecked and only Integrated Windows Auth checked.  The pertinate parts of my web.config look like this:
<authentication mode="Windows" />
<identity impersonate="true" />
<authorization>
<allow users="*" />
<deny users="?" />
</authorization>
My connection string looks like this:
public static string SqlServerConnect = "Integrated Security=SSPI;Initial Catalog=[name of database];Data Source=[sqlserver IP]";
The website (for now) is on my local development computer.  When I run the program everything works fine, when I attempt to view the web page on another computer, I get the following error
Server Error in '/reports' Application.
Login failed for user 'NT AUTHORITYANONYMOUS LOGON'.
I'm at a loss as to how to fix this.  I dont really want each user to have to enter any log in information, frankly, the permissions dont even matter in this case.  My main problem is with the sql connection and trying to get adequate permissions to run queries.
Any help would be apprieciated

View 2 Replies View Related

Linked Server && SQL Auth

Jan 21, 2007

I am stuck... I am trying to use a linked server in sql 2005 (xls sheet), it works great using windows authentication but since the program will not be running locally i would prefer to use sql auth...

when i log in using the sql name i have created. it only has connect & execute permissions on the main database (as it should), but i also need to query this linked server, when i try to query it i get authentication failed. how do i fix that?

the xls is on a fat32 partition and can be moved to an ntfs partition with out any problems.

thanks in advance

View 4 Replies View Related

NT Auth - Setup Group?

Sep 19, 2007

Usually, we set up a SQL login for an applucation to use.
On this occasion, the connection is being done through NT authentication.
I am having to set up a login for each DOMAINuser.

Is there a better way of doing this maybe a logn for a group and add the users to the group?

I assumed SQL login was the preferred way as if you designed an app for thousands of users, you would have a large amount of administration if everything was done through NT ?

View 1 Replies View Related

Error 0: Syntax Error Or Access Violation

Aug 1, 2004

Hi,
I'm writing a stored procedure and when I click on the Check Syntax button its giving me the error in the subject. I'm not really sure whats wrong with this. Here is my Stored Procedure code. Any help wud be appreciated.


CREATE PROC CabsSchedule_Insert
{
@JulianDatesmallint,
@SiteCodesmallint,
@CalendarDaysmallint,
@BillPeriodsmallint,
@WorkDaysmallint,
@CalDayBillRcvd varchar(30),
@Remarksvarchar(50)
}
AS
INSERT INTO CabsSchedule
(JulianDate, SiteCode, CalendarDay, BillPeriod, WorkDay, CalDayBillRcvd, Remarks)
VALUES
(@JulianDate, @SiteCode, @CalendarDay, @BillPeriod, @WorkDay, @CalDayBillRcvd, @Remarks)


Thanks,

View 2 Replies View Related

How To Tell If User Has Exec Auth On Sproc

Feb 6, 2008

And no, not through EM or SSMS

I want to interogate the catalog, so I can hae a job execute and do the grants in case a developer forgets

I mean I guess I can do the all everytime, but I don't know what the impact would be. It appears to be none, because of already done that, but in DB2 that would be bad as it would keep adding rows to the system tables

I have this so far


select *
from syspermissions p
inner join sysusers u
on u.uid = p.grantee
inner join sysobjects o
on o.id = p.id
where u.name = 'mepuser'
and o.name not like 'dt_%'
order by p.id



The M$ catalog is a royal pain

View 8 Replies View Related

Auth Problem To SQL In Web Administration Tool

Apr 30, 2008

I am trying to set up the web administration for a website that uses login controls. I have set up the ASPNETDB database using the regular aspnet_regsql command on my SQLEXPRESS.




To set up the web admin tool, I created a vdir to point to %WINDIR%Microsoft.NETFrameworkv2.0.50727ASP.NETWebAdminFiles. This works absolutely fine. I also changed the configuration of this website to use the ASPNETDB on my SQLEXPRESS.

<add name="LocalSqlServer" connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=aspnetdb"
providerName="System.Data.SqlClient" />




This website also has impersonation enabled

<identity impersonate = "true" />




The administration website works fine till I click on the security tab, and I get the following error:

Cannot open database "aspnetdb" requested by the login. The login failed. Login failed for user 'HOMEASPNET'

What I don't understand is why the application is using the ASPNET account to connect to the database when impersonation is enabled. Isn't it supposed to use the credentials of the windows user? I read a couple of posts on MSDN which advise to explicitly create a login for the ASPNET user in the ASPNETDB database (which will definitely work) but somehow it seems counter-intuitive to me. Any advise anyone?

View 8 Replies View Related

Application Connection String Using Windows Auth

Feb 7, 2008

OK

We have always used sql servwer login to the servers for all our applications for out intranet apps

And we use windows auth to do development

So when we do that we logon to wuindows, and then just connect, with no password required

But how does an application "logon" to connect to a database

Is it just in the connection string just like sql server auth

or is it different?

View 2 Replies View Related

Using Query Analyzer With Windows Auth Across Domains

Nov 3, 2005

Howdy,I have a SQL server in a completely different forrest than theworkstation I am running query analyzer on. However in query analyzerwhen I choose windows authentication I cannot manually specify"domainusername" as I could when mapping a file share across domainsor forests. Is there any way around this without resorting to using SQLServer authentication?Thanks

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved