Thread: ADO Connection String.

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    10

    ADO Connection String.

    I am currently having problems with my ADO connection string. I have searched all over the internet for a solution to this problem but I have yet to find a solution. Can someone help me with the proper configuration for a SQL OLEDB connection with a windows authentication? I have attached my C++ code file and a printscreen of my SQL Server Express signon screen.

  2. #2
    Registered User
    Join Date
    Jun 2009
    Posts
    10

    Connection Error Code.

    Attached is the error code I am getting.

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I looked at the error message just to see what kind of error message could possibly require 164K. I was very disappointed -- you could have (should have) just posted that, I'm thinking.

    Anyway, certainly no DB guru, never used ADO, so take with a very large mountain of salt, but: looking through the MSDN pages about logins (since that's the error you're getting, invalid username/password) suggests that Persist Security Info=true doesn't allow you to not give your password the first time, but merely allows you to get the username and password from the connection after a connection has been established.

  4. #4
    Registered User
    Join Date
    Jun 2009
    Posts
    10
    tabstop,

    After uploading the error code I found a more efficient way of doing this. In other posting I just copied my console message into the board. To respond to your message, I changed my Persist Security Info. but I continue to get an error message. The following is my error message after making this change:

    Error number: 80004005 Invalid authorization specification
    Error
    Code = 80004005
    Code meaning = U
    Source = Microsoft OLE DB Provider for SQL Server

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Not sure why you're only getting one letter out of your "code meaning", but you can look up 80004005 on MSDN to find out that is "User: Reason: Not defined as a valid user of a trusted SQL Server connection." which we already figured anyway. I have no idea how you're authentication is set up so I don't know much here.

    (If you get desperate: I noticed that all the examples I could find lacked quotes like you have, so instead of username='username' they had username=username. I have no idea if OLE cares, but I don't have much else.)

  6. #6
    Registered User
    Join Date
    Jun 2009
    Posts
    10
    tabstop,

    Thank you. I will look this up in MSDN.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. char Handling, probably typical newbie stuff
    By Neolyth in forum C Programming
    Replies: 16
    Last Post: 06-21-2009, 04:05 AM
  2. RicBot
    By John_ in forum C++ Programming
    Replies: 8
    Last Post: 06-13-2006, 06:52 PM
  3. OLEDB Connection String to Excel
    By gozlan in forum C# Programming
    Replies: 4
    Last Post: 07-06-2003, 01:42 PM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM