o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Error login in SQL server. -

I have a problem when accessing a SQL server from my VB application. Everything works fine on my test environment but when I was installing the application on the target environment I get the following error:

Error #-2147217843 Login failed for user 'UserName'.
NativeError: 18456
SQLState: 42000
Reported by: Microsoft OLE DB Provider for SQL Server
Help file:
Help Context ID: 0 :

This looks like the user doesn't have rights to the database, but what my problem is that when the same user uses the program on a different computer it works!?

I've tried to create an ODBC connection on the computer that cannot access the database and that works.

My code allows me to choose either to use ODBC or connect straight towards the database using trusted connection, no one works.

Here are my code for opening the database:

Public Function OpenDatabase() As Boolean
On Error GoTo ErrorHandler
'DebugPrint "OpenDatabase"
Set moConnect = New ADODB.Connection
moConnect.CommandTimeout = 600
If bUseODBC Then
moConnect.Open sDSN
Else
With moConnect
.Mode = adModeReadWrite
.ConnectionString = "Provider=sqloledb;server=" + sServer + "; database=" + sName + "; Trusted_Connection=yes"
.Open
.CursorLocation = adUseClient
End With
End If

OpenDatabase = True
Exit Function
ErrorHandler:
Dim objError As ADODB.Error
Dim strError As String
If Err.Number = -2147467259 Then
Resume Next
End If

If moConnect.Errors.Count > 0 Then
For Each objError In moConnect.Errors
strError = "Error #" & objError.Number & _
" " & objError.Description & vbCrLf & _
"NativeError: " & objError.NativeError & vbCrLf & _
"SQLState: " & objError.SQLState & vbCrLf & _
"Reported by: " & objError.Source & vbCrLf & _
"Help file: " & objError.HelpFile & vbCrLf & _
"Help Context ID: " & objError.HelpContext
DebugPrintError "OpenDatabase", , strError
Next
End If
DebugPrintError "OpenDatabase", Err.Number, Err.Description + " " + Err.Source
OpenDatabase = False

End Function

 

login error -
On my own pc i m trying to run a report...and I keep getting a login error some reports work fine..but this report keeps saying: login failed: 28880: [Microsoft] [ODB SQL Server Driver][SQL Server] Login failed for user Blah\username I hate crystal...so much Jon


SQL Server Login failed -
Hi, I have just updated my windows to windows XP prof. Then I have installed SQL Server 7 on this machine and created a login say abc with password abc giving this login all the possible rights to it. Now When I try to create a DSN for this login, it gives me an error - login fail


possible server cache problem -
I'm having a very wierd problem. In my ASP pages I access SQL Server 2000 that's on the same server as the web server. I created a uniques SQL login to minimize the access to the database. We recently changed the sa password on SQL and suddenly 1 of my ASP pages stopped working. It


Can someone give me some idea on login -
Dear all, I have an application require 2 logins, where 1 is the SQL Server login and the other one is the program's login, the program's login is getting the information from the SQL Server Login, which means that I have to login to SQL Server first. The problem comes, the progr


SQL Server error 18456 -
Hi all, In SQL Server 7, when Im trying to open a table (in enterprise manager) for which the user has previledges, it says that SQL Server error 18456 - Login failed. and it asks to login again. When I login again, it connects correctly. Why is this so? The user has all the righ


VBSQL TYPE MISMATCH ERROR -
Hello!, I am getting type mismatch error when I call vbsql functions. Private Sub Command1_Click() Dim result As Long 'Get a Login record and set login attributes. Login = SqlLogin() LoginID = Text2.Text passwd = Text3.Text result = SqlSetLUser(Login, LoginID)


SQL Server Login -
Dear all, i'm trying to establish a connection to a SQL Server 7. Until that point my application works fine, even the vb errorhandling but as soon as i get an error from the server i've no clue how to handle it. For example a wrong password - then the server pops up with the login di


[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'User'. -
I'm getting the following error when I try to connect to MSDE from my web app: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'User'. However, I can login via Enterprise Manager with the User I have created with no problems. The user has been setup with a


Login to SQL Server 2000 -
Hi my friends at VBForum i have installed Sql Server 2000 in windows 2003 server and when i want to connect to sql server in the server 10.18.0.200 an error apear . but when i add logon information of server windows in clinet windows using type \\10.18.0.200 and then


status of the server -
hi.. I m developing a project. I have a login form which has to be sensitive to thestatus of the server(MySQL server). if the server is stopped and if we try to login then a message has to pop up saying that the server is not running. And is able to login if the server is running. Can


I am getting an error while connecting to SQL Server Database. Pls Help. -
I am getting an error while connecting to SQL Server Database. I have configured everything PWS and ODBC. I am having Win98 and have installed PWS and I also configured ODBC for SQL Server. And also the connectivity is succeeded. And I am trying to update it And as soon I click on


I am getting an error while connecting ASP page to SQL Server. Pls help -
I am getting an error while connecting to ASP page SQL Server Database. I have configured everything PWS and ODBC. I am having Win98 and have installed PWS and I also configured ODBC for SQL Server. And also the connectivity is succeeded. And I am trying to update it And as soon I


[2005] help with MS SQL Server connection -
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (.Net SqlClient Data Provider) hi there, im trying to login on one of the server


Linked Server problem -
I'm having trouble accessing data over a linked server. Basically, I have a view in my database that gets it's data from a couple of tables in another database. I'm using SQL Server 2000. I started by making a regular linked server connection. The problem was that the instance of


Internet login system -
I'm working on a login system project. A user at the client types in his login name and password and sends it to the server. The server checks for the record in the database and grants access. However i get a runtime error if an invalid username is entered. How can i trap this? How can


Requesting Help Configuring Web Server -
We have a test server to run our website. I have the same website on my development machine. I want to copy some of my new pages to the test server for testing before they go to production. My problem is accessing the test server. The website is installed there (from production)


SQLDMO---Login failure problem -
Hai, I have written code for accessing servers and their data bases in network. now i have provided login and password for a perticular server and tried to connect to it through VB application using sqldmo. But an error has generated as---> login failure for the user servername/a


SQL Server 2000 asp.net login -
- VS.NET 2002 - SQL Server 2000 - Windows Server 2003 (web-server) - LAN - ASP.NET How should i open a Login for a web-server in the sql-server? There is an aspx-page on the web-server, which is reading data from the sql-database. Thanks in advance...! rgds.


Run-time error 40006 with wsock -
Im working on a client/server chat program and I cant find where I have went wrong. Once I login and try to join the lobby I get the run-time error 40006 wrong protocol or connection state for the requested transaction or request. Login with username and password. The error will occur


Send data to a web server by POST method -
Hi, I have one login page which is a html with form action for web server. How can i send the Login data to the server login php script via POST method from vb? I can't click on the Submit button in the login page since i m trying to implement automatic login. The login php script


help!!! to solve problem of asp.net and sql server connection -
Dear Friends I m trying to create a connection of sql server in an asp.net application. i used sqladapter wizard fot this. i m able to create connection and generate dataset and also preview it in design time. but when i run the application it gives me following error. C


Vb.net App - SQL Database Login -
I have a vb.net app connecting to a sql database. When I run the app on the PC running Sql Server it logins ok. When I try and run the app on a different PC, I get the following error System.Data.SqlClient.SqlException: Login failed for user 'BM-PC\Guest'. I am using the foll


Jobs and Packages and Logins Failing -
I am finished with my project and all I need is to figure out this error so please help. We have 2 servers. One webserver with sql2000 at a remote location accessed thru VPN and another on the local network with same configuration. On the local machine I scheduled a package to up


NT4 SERVER Login Scripts -
I know this isn't chit chat, but it isn't programming either. Here at work we have NT4 SERVER, now I have changed the login scripts for myself to change the location of some drives from the Server onto a network HDD. However, my computer insists on connecting to the server instead of


Talking to AIM server -
Is there a way to talk to an AIM server (like trillian does) and log in manually? Kinda like using a terminal screen to login to the net, like back in the day (I know that is a horrible analogy ). What are the sequence of commands that are sent to login to the AIM servers? Ie: Like


Best way to... -
connect to a windows 2000 server. Instead of having IIS running on the server, I would like to login to the server remotely and view the contents of a directory for ftp validation. I would need to provide the server with a username/password to login. Best way to go about this?


[2005] Login script to php file. (help) -
I am making a program that requires you to login, once you are login it will pull your info out of the database on the server. I am having a hard time making the login page. Buecase what I need it to do is to pull the info lets say http://xxxx.xxx/test12.php That script wi


SQL Server specialists out there! -
Hi! I wonder what is the best way to hook up to the SQL server. Is it a file or system DSN or something else? I use VB 6 and SQL Server 2000. The point is, I will need to install software on multiple workstations so I need to work out a flexible way to update connection parameters


WebBrowser Control & Server LogIn -
Hi guys, I have a problem that I've been trying to fix for weeks now. I have a webbrowser control as part of my application. The address is pointed to a server within the company where some pages are hosted. There is a special page posted for this application with all sorts of re


Security in SQL Server, using the Connection object. -
This is just as such a question about SQL Server as it is a question about ADO . . . I want to be able to keep my database and program secure by passing username and password in the connection's Open method. The Connection object is connecting to a SQL Server database using a DSN.


SQL Server trouble -
Hello, Please, anyone - I'm in deep #%^ here!! I have a sql db which I had to backup and upload to my web hosts in order for them to restore. They said I should delete all my log-in's before I do the backup. Now, without looking(thinking!!!!) I deleted the SERVER logins instead


SQL Server - BIG TROUBLE!!! -
Hello, Please, anyone - I'm in deep #%^ here!! I have a sql db which I had to backup and upload to my web hosts in order for them to restore. They said I should delete all my log-in's before I do the backup. Now, without looking(thinking!!!!) I deleted the SERVER logins instead


Login Failed (to SQL Server) -
Hi, I am getting the error message: "Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. Can anyone help me resolve this? Cheers, Bren.


Crystal Reports/VB ERROR -
Hello, I have Crystal Reports 8.0 and SQL Server 7.0. I am using VB 6.0 to develop crystal reports. I am getting the error "Server has not yet been opened" when I login as a user on client system. But if I login as an Administrator I am not getting the error message. I che


SQL Server gurus - PLEASE!!! Big Trouble!!!! -
Hello, Please, anyone - I'm in deep #%^ here!! I have a sql db which I had to backup and upload to my web hosts in order for them to restore. They said I should delete all my log-in's before I do the backup. Now, without looking(thinking!!!!) I deleted the SERVER logins instead


changing over from vb6 to 2k5 winsock questions -
Hi everyone, this is my first post, figured i would start off by saying HI, and see if someone can guide me in the right direction. I'm coming into VB2005 from VB6 so im used to winsock controls, and i notice they arent there in vb2005 (.net) so im assuming theres another way we handle


SQL Server Authoration -
Code: TITLE: Connect to Server ------------------------------ Cannot connect to TOOLSBOX\SQLEXPRESS. ------------------------------ ADDITIONAL INFORMATION: Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server


Login failed for user '(null)' -
Hello, I just got a new server with win 2k3 server pre installed and I am planning on using it for my database server. I used to have my SQL database on my domain server but I wanted to move it off to the new one too free up resources. I never had a problem connecting to my SQL server


Outlook.Mailitem -
Hi, I have developed a email client which sends & receives mail..using Outlook.Mailitem.. It is working fine but the problem is Before Starting my VBA I have to Start Microsoft Exchange to login my email ACC..If i dont do so..it gives a error that no Transport Provider is Specifi


My Client Tool Cant Access SQL -
Hi, I'm using MS SQL. I cant access the SQL Server using the client tool. It was ok til I re-booted my computer. It returns me this error message when i login: A connection could not be established to SERVER-NAME. Reason: SQL Server does not exist or access denied ConnectionOpe