0

I've been trying to connect SQL Server with VB6. I'm running Windows 2000 on VMWare. I've been unsuccessful in doing so. The error was on the connection string. How can I find the connection string details.

This is the current connection string:

.ConnectionString = "user ID=" & DBUser & ";password=" & DBPass & ";" + "Data source=" & strservername & ";" + "Initial Catalog= StudentManagementSystem"
        .Provider = "SQLOLEDB.1"

I get the error from err.description

Login failed for user 'dbo.'
John Saunders
  • 160,644
  • 26
  • 247
  • 397
don
  • 597
  • 2
  • 8
  • 28
  • Have you checked the values of DBUser and DBPass? Have you checked that a SQL login exists in the database matching those values? – Greg Oct 15 '12 at 03:44
  • Yes. DBUser = "dbo" and DBPass = "" – don Oct 15 '12 at 03:47
  • have you opened sql query editor and tried to connect using those credentials? – Greg Oct 15 '12 at 03:48
  • also the error says failed for user "dbo.". It's a bit unusual to have a login called dbo - normally that's used for a schema name. Maybe it's getting confused? – Greg Oct 15 '12 at 03:49
  • Do you know how to test it with the Query editor? – don Oct 15 '12 at 03:51
  • 1
    let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/18026/discussion-between-greg-and-user1122359) – Greg Oct 15 '12 at 03:52

2 Answers2

1

After discussing, tried using a trusted connection in the form of

Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

and after fixing the servername it worked.

Greg
  • 3,442
  • 3
  • 29
  • 50
0

Dbo. Is not a user name its a schema. You need to verify the username.

Wjdavis5
  • 3,952
  • 7
  • 35
  • 63