Db_sec_e_auth_failed[resolved]-VBForums
Results 1 to 2 of 2

Thread: Db_sec_e_auth_failed[resolved]

  1. #1

    Thread Starter
    Hyperactive Member Grunt's Avatar
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    498

    Resolved Db_sec_e_auth_failed[resolved]

    i am trying to open a access database from an open file dialog box, and get its information. However, i am recieving the following error:

    DB_SEC_E_AUTH_FAILED

    i know that it has to do with my connection string. i have a textbox on my form that allows the user to type in the login and password if there is one.

    VB Code:
    1. Private Sub btnBrowseDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowseDB.Click
    2.         Dim loginvar = Me.txtLogin.Text
    3.         Dim passvar = Me.txtPassword.Text
    4.         Dim dt As DataTable
    5.         Dim filepath As String = " Data Source=" & opnExport.FileName.ToString
    6.         Dim login As String = "; User Id=" & loginvar
    7.         Dim pass As String = "; Password=" & passvar
    8.         Dim provider As String = "Provider=Microsoft.Jet.OLEDB.4.0; "
    9.         Dim connectionstring As String = provider & filepath & login & pass
    10.  
    11.         With opnExport
    12.             .Filter = "Access Database (*.mdb)|*.mdb"
    13.             .FilterIndex = 1
    14.             .InitialDirectory = Application.StartupPath
    15.             .Title = "Open Access Database"
    16.         End With
    17.  
    18.         If opnExport.ShowDialog() = DialogResult.OK Then
    19.             Dim dbConnect As New OleDb.OleDbConnection(connectionstring)
    20.             dbConnect.Open()
    21.             dt = dbConnect.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "Table"})
    22.             MsgBox(dt.ToString)
    23.         End If
    24.  
    25.         Me.txtDBPath.Text = opnExport.FileName.ToString
    26.     End Sub
    Last edited by Grunt; Nov 30th, 2004 at 09:50 PM.

  2. #2

    Thread Starter
    Hyperactive Member Grunt's Avatar
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    498
    oops, im stupid.

    i needed to put all the dims in the if block.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.