Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Application / SQL Security

Author  Topic 

OMB
Yak Posting Veteran

88 Posts

Posted - 2003-10-14 : 09:45:45
I have an application that connects as TestUser to the sql database in the connection string and works no problem. However, when I install the application on another P.C it keeps on comming up with errors. the only way i can clear these error is by adding the users domain account that the p.c uses to the logins in SQL server. is there a way i can stop this from happning? Am I missing something. your help will be much appreciated.

OMB

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-10-14 : 12:17:01
Well how is this other user connecting? With sql authentication? What is the error? Is sql authentication allowed on the SQL Server (be default only windows authentication is selected in the installation)?

Tara
Go to Top of Page

OMB
Yak Posting Veteran

88 Posts

Posted - 2003-10-14 : 12:24:51
Hi Tara

The user is connecting with the same connection string with the same user i.e. test user. The error is saying "operation is not allowed whilst the object is closed" This points to the database connection not being open for the neccessary query to run.

thanks for your help
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-10-14 : 12:33:28
Is that the exact error message? If it is, then I don't think that it is a SQL Server error. I get nothing on it when I google it or when I check MS' knowledge base.

Tara
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-10-14 : 23:48:27
That is an ADO error.
Perhaps if you can show us some of the code you are using we can help troubleshoot.


Damian
Go to Top of Page

OMB
Yak Posting Veteran

88 Posts

Posted - 2003-10-15 : 05:36:57
Ok Guys

i'm getting even more confused with this error now.

here is my connection string



gcConnectionString As String = "Provider=SQLOLEDB;Integrated Security=SSPI;Persist Security Info=False;"

Set goCN = New ADODB.Connection

sConnectionString = gcConnectionString & "Data Source=" & sDatabaseServer & ";Initial Catalog=" & sDatabaseName

If Not IsMissing(strUserName) Then sConnectionString = sConnectionString & ";User ID=" & strUserName

MsgBox sConnectionString

goCN.ConnectionString = sConnectionString
goCN.Open

where gsuser is the testuser login for Sql
sDatabaseServer is the databse server and
sDatabaseName is the database

I have added some error trapping and the error message reads "login failed for user and then the domain login for that particular user. where the hell is it getting this from. Like i said if i add this user to the SQL server i have no problems.

Thanks for your help

OMB




Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2003-10-16 : 16:08:07
Integrated Security=SSPI; is the culprit. This parameter tells it that you want to use Windows Authentication instead of the SQL Authentication, so it ignores whatever you put in Username and uses the Windows login information. Remove that part of your gcConnectionString and it should work fine.

And remember to add the password, too.

--------------------------------------------------------
Visit the SQLTeam Weblogs at [url]http://weblogs.sqlteam.com[/url]
Go to Top of Page

OMB
Yak Posting Veteran

88 Posts

Posted - 2003-10-17 : 04:38:28
Mark

you're a star

OMB
Go to Top of Page
   

- Advertisement -