SQL User Authentication

  • Hi,

    Im new to SQL and am really struggling with this problem.

    From a VB application(a SCADA package) I am opening a connection to an SQL database to run a report - the connection code opens fine (ODBC). I am using Windows Authentication. The User that is launching the report is a domain user. This Domain user is part of a Domain Users groups on SQL.

    On running report after approx 30-45 seconds I get the following error

    [Microsoft][ODBC SQL Server Driver][DBNETLIB]Connection Write (send ()).

    However If I create the Domain account in SQL rather than depending on it being recognized as part of the Domain group than this error dose not occur and report launches within seconds. This is an intermittent error. So at times its seems that that it cannot authenticate the user with the domain controller.

    Hope someone can shed some light on this for me

    Thanks

    Ant

  • Hi

    First, why do you use ODBC? If you work with VB.NET use SqlClient. If you work with VB6 you should use ADODB.

    Second, did you try to install the latest drivers?

    Greets

    Flo

  • Hi Florian

    Thanks for reply -Im not using VB NET or VB6 - just VBA. I am opening connection

    using ADODB. All the latest drivers are installed. The connection always opens

    without error. The problem seems to be when SQL has to authenticate with the domain

    I am unsure how to even test if this is problem...

    Ant

  • Hi Ant

    Disclaimer: My last VBA is about ten years ago 😛

    If you use ADO you should use OLEDB instead of ODBC. Give this connection string a try:

    Provider=SQLOLEDB.1;Data Source=YourServer;Initial Catalog=YourDatabase;Integrated Security=SSPI;

    To your error:

    If I'm correct ADODB has (just like ADO.NET) a default command timeout of 30 seconds. There must be a property on your command or connection object which allows you to set "0" (zero) what usually means run forever.

    Hope this helps!

    Flo

  • Hi Flo

    Tried using OLEDB but this time the error is

    [DBNETLIB]ConnectionWrite (send()) General Network Error Check your network documentation

    Again it is intermittient at times it cant authenticate...

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply