SQL Server OLE DB Provider

  • We have a VB application connecting to SQL Server 2000, using OLE DB Provider (MDAC 2.6 SP1).

    We receive the following message "Cannot open database requestes in login 'DBName'"

    Error code: -2147467259

    This is happening in our production environment, but not in our development enviromnet.

    It's quite rear, don't you think ?

    All ideas are welcome.

    Regards, Mariano

  • First what does the app do?

  • quote:


    First what does the app do?


    The app tries to connect the DB as first step.

    So, we prepare the string connection and then we execute the open connection.

    The third line of our code get the error.

    We probe it using ODBC connection, and it works.

  • Sounds like security. Can you log in with QA using the SAME login as the app and open the database?

    Steve Jones

    steve@dkranch.net

  • Can you post that section of code with username as username and password as pword so I can see what it does.

  • quote:


    Can you post that section of code with username as username and password as pword so I can see what it does.


    Option Explicit

    Public cnxConnection As New ADODB.Connection

    Private Sub Form_Load()

    Dim ConnectionString As String

    Dim DBServerName As String

    App.Title = "FastFoodApp"

    DBServerName = GetSetting(appname:=App.Title, Section:="Parameters", Key:="DBServerName", Default:="")

    ConnectionString = "Provider = SQLOLEDB; Data Source = " & DBServerName & "; Initial catalog = FastFood; UID=UserFastFood; PWD=fastfood;"

    ' DataBase Connection

    On Error GoTo ConnectionERR

    MsgBox ConnectionString

    cnxConnection.Open ConnectionString

    cnxConnection.Close

    MsgBox "Todo bien"

    Unload Me

    On Error GoTo EndLoad

    Exit Sub

    ConnectionERR:

    MsgBox "Database connection error." & Chr(10) & Chr(13) & Err.Description & Err.Number

    MsgBox "System will be stopped"

    Unload Me

    Exit Sub

    EndLoad:

    MsgBox "System will be stopped" & Err.Description

    Unload Me

    End Sub

  • quote:


    Sounds like security. Can you log in with QA using the SAME login as the app and open the database?

    Steve Jones

    steve@dkranch.net


    We use query analyzer to probe the user, and it works.

  • Do the folowing. Put a break point at

    ConnectionString = "Provider = SQLOLEDB; Data Source = " & DBServerName & "; Initial catalog = FastFood; UID=UserFastFood; PWD=fastfood;"

    and when you pass it by one step do a PRINT ConnectionString and enter in the intermediate window to see what your connection string looks like (if you don't mind post here if no obvious problem).

    Now if you find no problem there can you post the code to GetSetting from the following.

    DBServerName = GetSetting(appname:=App.Title, Section:="Parameters", Key:="DBServerName", Default:="")

    I do not see a problem otherwise at this point.

  • quote:


    Do the folowing. Put a break point at

    ConnectionString = "Provider = SQLOLEDB; Data Source = " & DBServerName & "; Initial catalog = FastFood; UID=UserFastFood; PWD=fastfood;"

    and when you pass it by one step do a PRINT ConnectionString and enter in the intermediate window to see what your connection string looks like (if you don't mind post here if no obvious problem).

    Now if you find no problem there can you post the code to GetSetting from the following.

    DBServerName = GetSetting(appname:=App.Title, Section:="Parameters", Key:="DBServerName", Default:="")

    I do not see a problem otherwise at this point.


    Sorry, now we are going to reinstall SQL Server 2000.

    Three differents programmers saw the code and debug the app.

    And no one found out anything bad.

    Remember, in our development environment the app works perfectly.

  • But the problem error code in the ado reference set states "Data source name not found and no default driver specified", I don't feel it is the server but the way you are connecting. Check out the follwoing article from Microsoft <A href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;q186063">here.</a> Try this and see if it works, change the PROVIDER = SQLOLEDB to SQLOLEDB.1 which is what I have always used and seen in all Microsoft examples. May be something in the MDAC itself.

  • quote:


    quote:


    Do the folowing. Put a break point at

    ConnectionString = "Provider = SQLOLEDB; Data Source = " & DBServerName & "; Initial catalog = FastFood; UID=UserFastFood; PWD=fastfood;"

    and when you pass it by one step do a PRINT ConnectionString and enter in the intermediate window to see what your connection string looks like (if you don't mind post here if no obvious problem).

    Now if you find no problem there can you post the code to GetSetting from the following.

    DBServerName = GetSetting(appname:=App.Title, Section:="Parameters", Key:="DBServerName", Default:="")

    I do not see a problem otherwise at this point.


    Sorry, now we are going to reinstall SQL Server 2000.

    Three differents programmers saw the code and debug the app.

    And no one found out anything bad.

    Remember, in our development environment the app works perfectly.


    We reinstall SQL Server 2000 and now everything is working OK.

    Antares686 and Steve,

    Thank you very much for your cooperation and your time.

    Regards, Mariano

  • Hem, from the error that is odd, unless did you run the app from the server itself or a remote machine. If the server then I believe it was problem with the MDAC since it will reinstall when SQL does anyway. If not then I am baffeled as to why but it is good it is fixed.

Viewing 12 posts - 1 through 11 (of 11 total)

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