Showing posts with label setup. Show all posts
Showing posts with label setup. Show all posts

Friday, March 30, 2012

Problem with sql2005 query/storedproc

I am working on the login portion of my app and am using my own setup for the moment so that I can learn more about how things work. I have 1 user setup in the db and am using a stored procedure to do the checking for me, here is the stored procedure code:

ALTER PROCEDUREdbo.MemberLogin(@.MemberNamenchar(20),

@.MemberPasswordnchar(15),

@.BoolLoginbit OUTPUT

)

AS

selectMemberPasswordfrommemberswheremembername = @.MemberNameandmemberpassword = @.MemberPassword

if@.@.Rowcount = 0

begin

selectBoolLogin = 0

return

end

selectBoolLogin=1

/* SET NOCOUNT ON */

RETURN

When I run my app, I continue to get login failed but no error messages. Can anybody help? Here is my vb code:

Dim MemberNameAsString

Dim MemberPasswordAsString

Dim BoolLoginAsBoolean

Dim DBConnectionAsNew Data.SqlClient.SqlConnection(MyCONNECTIONSTRING)

Dim SelectMembersAsNew Data.SqlClient.SqlCommand("MemberLogin", DBConnection)

SelectMembers.CommandType = Data.CommandType.StoredProcedure

MemberName = txtLogin.Text

MemberPassword = txtPassword.Text

Dim SelectMembersParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter

'Name

SelectMembersParameter.ParameterName ="@.MemberName"

SelectMembersParameter.Value = MemberName

SelectMembers.Parameters.Add(SelectMembersParameter)

'Password

Dim SelectPasswordParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter

SelectPasswordParameter.ParameterName ="@.MemberPassword"

SelectPasswordParameter.Value = MemberPassword

SelectMembers.Parameters.Add(SelectPasswordParameter)

Dim SelectReturnParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter

SelectReturnParameter.ParameterName ="@.BoolLogin"

SelectReturnParameter.Value = BoolLogin

SelectReturnParameter.Direction = Data.ParameterDirection.Output

SelectMembers.Parameters.Add(SelectReturnParameter)

If BoolLogin =FalseThen

MsgBox("Login Failed")

ElseIf BoolLogin =TrueThen

MsgBox("Login Successful")

EndIf

EndSub

Thank you!!!

Perhaps its because of the nchar's you are using. CHAR is used for a fixed width string so if you send in a string which is less than the specified length it will be padded with extra spaces at the end. I would modify your code as follows:

ALTER PROCEDURE dbo.MemberLogin(@.MemberNamenvarchar(20),@.MemberPasswordnvarchar(15),@.BoolLoginbit OUTPUT)ASBEGINSET NOCOUNT ON-- @.BoolLogin =0 ==> Does not exist, @.BoolLogin=1 ==> ExistsSET @.BoolLogin =0IFEXISTS(select MemberPasswordfrom memberswhere membername = @.MemberNameand memberpassword = @.MemberPassword)SET @.BoolLogin = 1SET NOCOUNT OFFEND
|||

Hello all, I am still having problems and am very frustrated. I have looked and ready over a dozen articles on ado/asp/sql and cannot seem to figure this out. I have a sql db I added using the add components part of asp. It is local, IIS is active. As far as i can tell servername is 'local'. This is the code I am running:

visual basic code:
Imports System.DataImports System.Data.SqlClientPartialClass _DefaultInherits System.Web.UI.PagePrivateConst MyCONNECTIONSTRINGAsString = "Server=(local);Database=Vex;Trusted_Connection=True"ProtectedSub btnLogin_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles btnLogin.ClickDim MemberNameAsStringDim MemberPasswordAsStringDim BoolLoginAsBooleanDim testAsStringDim DBConnectionAsNew Data.SqlClient.SqlConnection(MyCONNECTIONSTRING)Dim SelectMembersAsNew Data.SqlClient.SqlCommand("MemberLogin", DBConnection) SelectMembers.CommandType = Data.CommandType.StoredProcedure 'open the connection to the db DBConnection.Open() MemberName = txtLogin.Text MemberPassword = txtPassword.Text 'NameDim SelectMembersParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter SelectMembersParameter.ParameterName = "@.MemberName" SelectMembersParameter.Value = MemberName SelectMembers.Parameters.Add(SelectMembersParameter) 'PasswordDim SelectPasswordParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter SelectPasswordParameter.ParameterName = "@.MemberPassword" SelectPasswordParameter.Value = MemberPassword SelectMembers.Parameters.Add(SelectPasswordParameter) 'Pass or Fail VariableDim SelectReturnParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter SelectReturnParameter.ParameterName = "@.BoolLogin" SelectReturnParameter.Value = BoolLogin SelectReturnParameter.Direction = Data.ParameterDirection.Output SelectMembers.Parameters.Add(SelectReturnParameter) test = SelectMembers.ExecuteScalar()EndSubEndClass

I get this error when i try to login on the .open line:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

If i try to execute the .scalar w/o the line it tells me i need an open connection, but when I try to open the connection it throws this error. What am I doing wrong? Is there some setup piece(s) I am missing? I have gone through a basic install of vs2005 with no settings changes to sql05. Any help is greatly appreciated as I am at my wits end with this and I know it is going to be something simple......

as an added note, here is the connection string in the web.config file:

visual basic code:
<connectionStrings> <add name="csVex" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Vex.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>
I went into sql2005 surface configuration and made sure all protocols are enabled. I am an admin locally on my machine. I do not know what else to check or do at this point.

Thanks for your help....

|||

Just in case anybody else runs into this. I created a new project and added a datasource to that project pointing to my sql 2005 database. I then copied the connectionstring from that connection and pasted it in my CONST connectionstring. Error went away.

Good Luck!!

Wednesday, March 28, 2012

Problem with SQL Service Pack 4

You can review the setup log for any errors (file called sqlsp.log in the
windows directory). It is perfectly safe to run SP4 again to try and make it
stick (assuming you have the system database backups just in case you need
to regress)
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Leon Parker" <u23479@.uwe> wrote in message news:625d255c1f101@.uwe...
>I upgraded from SQL 2000 Service Pack 3 to SQL 2000 Service Pack 4. The
> install says it completed but after I rebooted and did a select @.@.version
> it
> still shows SP3. I only have a default instance so I know that it
> installed
> on the right instance. Could anyone help me out with this?I tried it several times but got the same result.
I've attached a copy of my sqlsp.log file. I looked at the sqlsp.log file
and it only listed one non-fatal error...I can't see this being the problem
considering it was nonfatal.
Jasper Smith wrote:[vbcol=seagreen]
>You can review the setup log for any errors (file called sqlsp.log in the
>windows directory). It is perfectly safe to run SP4 again to try and make i
t
>stick (assuming you have the system database backups just in case you need
>to regress)
>|||I upgraded from SQL 2000 Service Pack 3 to SQL 2000 Service Pack 4. The
install says it completed but after I rebooted and did a select @.@.version it
still shows SP3. I only have a default instance so I know that it installed
on the right instance. Could anyone help me out with this?|||You can review the setup log for any errors (file called sqlsp.log in the
windows directory). It is perfectly safe to run SP4 again to try and make it
stick (assuming you have the system database backups just in case you need
to regress)
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Leon Parker" <u23479@.uwe> wrote in message news:625d255c1f101@.uwe...
>I upgraded from SQL 2000 Service Pack 3 to SQL 2000 Service Pack 4. The
> install says it completed but after I rebooted and did a select @.@.version
> it
> still shows SP3. I only have a default instance so I know that it
> installed
> on the right instance. Could anyone help me out with this?|||I tried it several times but got the same result.
I've attached a copy of my sqlsp.log file. I looked at the sqlsp.log file
and it only listed one non-fatal error...I can't see this being the problem
considering it was nonfatal.
Jasper Smith wrote:[vbcol=seagreen]
>You can review the setup log for any errors (file called sqlsp.log in the
>windows directory). It is perfectly safe to run SP4 again to try and make i
t
>stick (assuming you have the system database backups just in case you need
>to regress)
>|||What does the following query return?
SELECT SERVERPROPERTY('ProductLevel')
Hope this helps.
Dan Guzman
SQL Server MVP
"Leon Parker" <u23479@.uwe> wrote in message news:625d255c1f101@.uwe...
>I upgraded from SQL 2000 Service Pack 3 to SQL 2000 Service Pack 4. The
> install says it completed but after I rebooted and did a select @.@.version
> it
> still shows SP3. I only have a default instance so I know that it
> installed
> on the right instance. Could anyone help me out with this?|||What does the following query return?
SELECT SERVERPROPERTY('ProductLevel')
Hope this helps.
Dan Guzman
SQL Server MVP
"Leon Parker" <u23479@.uwe> wrote in message news:625d255c1f101@.uwe...
>I upgraded from SQL 2000 Service Pack 3 to SQL 2000 Service Pack 4. The
> install says it completed but after I rebooted and did a select @.@.version
> it
> still shows SP3. I only have a default instance so I know that it
> installed
> on the right instance. Could anyone help me out with this?|||SP3....
Dan Guzman wrote:[vbcol=seagreen]
>What does the following query return?
> SELECT SERVERPROPERTY('ProductLevel')
>
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200606/1|||SP3....
Dan Guzman wrote:[vbcol=seagreen]
>What does the following query return?
> SELECT SERVERPROPERTY('ProductLevel')
>
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200606/1

Problem with SQL Server 2005 Standard Edition installation

Hello,

When I try to install SQL Server 2005 Standard Edition, Windows XP SP2, setup fails.

Please help!!!

This is log file:

..............................

Loaded DLL:
C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\DbgHelp.dll
Version:
6.5.3.7
MSI (s) (98:E8) [12:19:07:890]: Leaked MSIHANDLE (6010) of type 790531 for thread 2260
MSI (s) (98:E8) [12:19:07:890]: Leaked MSIHANDLE (6009) of type 790540 for thread 2260
MSI (s) (98:E8) [12:19:07:890]: Leaked MSIHANDLE (6008) of type 790541 for thread 2260
MSI (s) (98:E8) [12:19:07:890]: Leaked MSIHANDLE (5973) of type 790541 for thread 2260
MSI (s) (98:E8) [12:19:07:890]: Leaked MSIHANDLE (5970) of type 790531 for thread 2260
MSI (s) (98:E8) [12:19:07:890]: Note: 1: 2769 2: Write_sqlLocalServers.D20239D7_E87C_40C9_9837_E70B8D4882C2 3: 5


Info 2769.The installer has encountered an unexpected error. The error code is 2769. Custom Action Write_sqlLocalServers.D20239D7_E87C_40C9_9837_E70B8D4882C2 did not close 5 MSIHANDLEs.
MSI (s) (98:2C) [12:19:07:890]: Machine policy value 'DisableRollback' is 0
MSI (s) (98:2C) [12:19:07:890]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
Action ended 12:19:07: Write_sqlLocalServers.D20239D7_E87C_40C9_9837_E70B8D4882C2. Return value 3.
MSI (s) (98:2C) [12:19:07:890]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
MSI (s) (98:2C) [12:19:07:890]: No System Restore sequence number for this installation.
MSI (s) (98:2C) [12:19:07:890]: Unlocking Server
Action ended 12:19:07: INSTALL. Return value 3.
Property(S): ProductCode = {28B22773-100E-4AF2-A1C9-2F2EA8A35844}
Property(S): ProductLanguage = 1033

You did not say what version of XP you are running because you cannot install SQL Server 2005 Standard in XP Home, if you are running Media edition or Pro copy the content of the CDs/DVD into a folder in your C drive and run setup from your C drive. One more thing if you intend to install Reporting Services make sure IIS is running or the installer will skip it without telling you why. Hope this helps.

|||From the error message in the log, it appears that you have a setting on your machine which is preventing the systemstate backup to be rolled back. Check with your network administrator about disabling this setting.|||

I have Windows XP professional. IIS is running. Installation from C is also failed.

May be, I uninstalled incorrectly beta-version of Visual studio 2005 and/or SQL Server 2005.

I uninstalled all components and then cleaned register, but it didn't help.

Thanks.

Gato.

|||

Please comment what setting "is preventing the systemstate backup to be rolled back" , where and how can I check that?

I work without network administrator .

Thanks,

Gato.

|||

Gato wrote:

I have Windows XP professional. IIS is running. Installation from C is also failed.

May be, I uninstalled incorrectly beta-version of Visual studio 2005 and/or SQL Server 2005.

I uninstalled all components and then cleaned register, but it didn't help.

Thanks.

Gato.

Lets start with some WinXP system restore to the last available restore point and copy the files to the C and install from C drive. And I just noticed you are not running the standard setup, because I know the bootstrap setup runs for a short while and terminates. The 2005 installer is very easy I know because I had installed 2000 on all operating systems including 64bits except Vista and it was a pain but installing 2005 was a breeze. Keep me posted and pay attention to the installer don't answer questions not relevant to you.

Monday, March 26, 2012

problem with SQL Agent

OK this is a new error on me.
I have a SQL server 2000 on Windows Server 2003.
I have setup a Maint plan that backs up the user and system databases
and the transaction Logs on my user databases.
Does optimises and integrity checks on those databases as well.
I am not attempting to repair any minor problems.
I am not performing integrity checks before backing up the database
and transaction logs.
All of the databases that I am doing a transaction log backup on have
recovery mode of full.
When the jobs run they fail instantly with error code 22029.
Sqlmaint.exe failed to run. This was working up until the end of the
day on the Thursday before Good Friday. (last week) The transaction
log backup ran fine at 4:00 PM the same job failed at 8:00 PM. No
changes were made to the server during that time.
Another issue that started at the same time. I have a web page used to
grab data from a text file export and pull it into an AS400. I use
this server to house the DTS packages and stored procedures that the
process needs. I suddenly quit working when the jobs quit running.
We are in a mixed enviroment with most clients on AD and this server
and most others still in a NT 4 domain. We have been like this for at
least 3 months and everything has worked fine. I setup the various
users and systems the way the need to be to work.
Originally the SQL Agent was running as a generic NT 4 Domain user with
local administrator rights to the local box and server role of system
administrator. The MSSQLSERVER and DTC services were running as the
built in system account.
Everything was happy then it broke.
When I reboot the server the jobs and the website work fine. Then
after a period of time that I have not figured out yet, but more than
15 minutes and less than 2 hours. Everything quits working.
I have changed all the services to run as a domain admin with SQL
system adminsitrator server role. Still same thing.
I have changed all the services to run as the built in system account.
Still same thing.
I run the sqlmaint from command line with the switches that I am using
in the maint jobs and it runs fine.
I have run dbcc checkdb on all the databases and they are fine.
The DTS packages and the stored procedures used by the website run fine
from with in Query analyzer.
Any help you can provide would be greatly appreciated.A guess: Try disabling the IPSec service. I've seen some similar behavior
when this service was misconfigured.
Also I would make sure the system is configure to log all security failures
and take a good look at the Security event log for any additional clues.|||Kevin,
Thanks for the reply. I already had the security set to log failure
and it is showing nothing but success audits.
I stopped the IPSec service and I still couldn't run the job. Do i
need to restart the server after making that change?
Kevin Joyner
Kevin English wrote:
> A guess: Try disabling the IPSec service. I've seen some similar behavio
r
> when this service was misconfigured.
> Also I would make sure the system is configure to log all security failure
s
> and take a good look at the Security event log for any additional clues.

problem with SQL Agent

OK this is a new error on me.
I have a SQL server 2000 on Windows Server 2003.
I have setup a Maint plan that backs up the user and system databases
and the transaction Logs on my user databases.
Does optimises and integrity checks on those databases as well.
I am not attempting to repair any minor problems.
I am not performing integrity checks before backing up the database
and transaction logs.
All of the databases that I am doing a transaction log backup on have
recovery mode of full.
When the jobs run they fail instantly with error code 22029.
Sqlmaint.exe failed to run. This was working up until the end of the
day on the Thursday before Good Friday. (last week) The transaction
log backup ran fine at 4:00 PM the same job failed at 8:00 PM. No
changes were made to the server during that time.
Another issue that started at the same time. I have a web page used to
grab data from a text file export and pull it into an AS400. I use
this server to house the DTS packages and stored procedures that the
process needs. I suddenly quit working when the jobs quit running.
We are in a mixed enviroment with most clients on AD and this server
and most others still in a NT 4 domain. We have been like this for at
least 3 months and everything has worked fine. I setup the various
users and systems the way the need to be to work.
Originally the SQL Agent was running as a generic NT 4 Domain user with
local administrator rights to the local box and server role of system
administrator. The MSSQLSERVER and DTC services were running as the
built in system account.
Everything was happy then it broke.
When I reboot the server the jobs and the website work fine. Then
after a period of time that I have not figured out yet, but more than
15 minutes and less than 2 hours. Everything quits working.
I have changed all the services to run as a domain admin with SQL
system adminsitrator server role. Still same thing.
I have changed all the services to run as the built in system account.
Still same thing.
I run the sqlmaint from command line with the switches that I am using
in the maint jobs and it runs fine.
I have run dbcc checkdb on all the databases and they are fine.
The DTS packages and the stored procedures used by the website run fine
from with in Query analyzer.
Any help you can provide would be greatly appreciated.A guess: Try disabling the IPSec service. I've seen some similar behavior
when this service was misconfigured.
Also I would make sure the system is configure to log all security failures
and take a good look at the Security event log for any additional clues.|||Kevin,
Thanks for the reply. I already had the security set to log failure
and it is showing nothing but success audits.
I stopped the IPSec service and I still couldn't run the job. Do i
need to restart the server after making that change?
Kevin Joyner
Kevin English wrote:
> A guess: Try disabling the IPSec service. I've seen some similar behavior
> when this service was misconfigured.
> Also I would make sure the system is configure to log all security failures
> and take a good look at the Security event log for any additional clues.

Friday, March 9, 2012

Problem with replication job schedule

We have recently setup a snapshot replication on a SQL Server 2000 server.
It's an unusual replication, since it's replicating from one database to
another on the same server (because of the interaction between two 3rd party
applications).
My problem is that when I set the job schedule's "enabled" setting to "yes"
(through the snapshot agent properties under the "schedules" tab) the job
runs at the scheduled time (daily at 11:00 PM) and has a status of
successful, but the "enabled" setting changes to "no" and I have to reset it
to "yes" the next day.
Another orginization that has a similar setup has been using this method for
a few years without a problem, so I assume this should work.
I'm not seeing anything unusual in the logs. Is there anything else that I
can look at to narrow down the problem? Has anyone come across this type of
problem before?
Oh brother. I was about to respond back with:
It is set to "Recurring" with "Occurs every 1day(s), at 11:05:00 PM".
But when I clicked on the "Change" button to examine it more closely I saw
the duration was set to "End Date" of the current date, rather than "No End
Date". Someone else had setup the replication and I assumed it was set up
properly because of what I was seeing on the other screen. I should have
caught that. Thanks for the response. I might not have checked that more
closely for quite a while.
"Paul Ibison" wrote:

> David - is the job set on a recurring schedule. It sounds like it is set on
> a schedule to execue one time only.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
>
>

Wednesday, March 7, 2012

Problem with queued updating in transactional repl on win/SQL 2000

Hey guys. I've 2 servers with SQL 2000. I've a publisher/distributor and a
subscriber. Now, there is a queued updating setup between this two with push
replication. I'm trying to replicate the employees table of Northwind
database only. the primary key is setup to use identity ranges on the 2
servers. The problem I'm facing is that, when I insert/update data on a
publisher, it gets replicated fine to subscriber, no matter what. But, when I
try to insert data at the subscriber, it doesn't work(update works fine). It
gives me an error msg2627. violation of a primary key constraint at the
subscriber. It says 'cannot insert duplicate key in object 'Employees'. The
thing is that I'm using identity for the primary key. So, I'm very confused
as to what this is saying. Please help. Thank you.
Tejas,
sounds like you haven't set up automatic identity range management, and hte
identity values are clashing. In the article properties you can see this
option, but it'll require reinitialization. As a stop-gap you could reseed
the identity range on the subscriber (dbcc checkident).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)