Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. connect to password-protected access-file

connect to password-protected access-file

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasetutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Smithers Jones
    wrote on last edited by
    #1

    vb.net URGENT! i am loading data from an access-database like this: dim MyConnection As String = "Provider= Microsoft.Jet.OLEDB.4.0; Data Source=MyDatabase.mdb;" dim connStr As String = "SELECT * FROM table1" dim odc As OleDbConnection= New OleDbConnection(MyConnection ) dim oda As OleDbDataAdapter= New OleDbDataAdapter(connStr, odc) dim odb As OleDbCommandBuilder= New OleDbCommandBuilder(oda) dim dat As DataTable= New DataTable("MyDatatable") dim bmb As BindingManagerBase odc.Open() oda.Fill(dat) odc.Close() bmb = Me.BindingContext(dat) datagrid1.DataSource = dat now i want to use a password-protected database. where do i have to insert the password in the example above? (i know that i shouldn't write the password into my code, but the file doesn't contain critical data. i just want to prevent, that user's messing up the file) and please, i need a solution for this example, not another way of connecting to the mdb-file, since i don't want to rewrite half of my project. thanks.

    H 1 Reply Last reply
    0
    • S Smithers Jones

      vb.net URGENT! i am loading data from an access-database like this: dim MyConnection As String = "Provider= Microsoft.Jet.OLEDB.4.0; Data Source=MyDatabase.mdb;" dim connStr As String = "SELECT * FROM table1" dim odc As OleDbConnection= New OleDbConnection(MyConnection ) dim oda As OleDbDataAdapter= New OleDbDataAdapter(connStr, odc) dim odb As OleDbCommandBuilder= New OleDbCommandBuilder(oda) dim dat As DataTable= New DataTable("MyDatatable") dim bmb As BindingManagerBase odc.Open() oda.Fill(dat) odc.Close() bmb = Me.BindingContext(dat) datagrid1.DataSource = dat now i want to use a password-protected database. where do i have to insert the password in the example above? (i know that i shouldn't write the password into my code, but the file doesn't contain critical data. i just want to prevent, that user's messing up the file) and please, i need a solution for this example, not another way of connecting to the mdb-file, since i don't want to rewrite half of my project. thanks.

      H Offline
      H Offline
      H is here
      wrote on last edited by
      #2

      Hello In your connection string: dim MyConnection As String = "Provider= Microsoft.Jet.OLEDB.4.0; Data Source=MyDatabase.mdb;persist Security Info=False;Jet OLEDB:Database Password=sysadm" Where sysadm is your password. Tip: Don´t use that password :-D Regards

      S 1 Reply Last reply
      0
      • H H is here

        Hello In your connection string: dim MyConnection As String = "Provider= Microsoft.Jet.OLEDB.4.0; Data Source=MyDatabase.mdb;persist Security Info=False;Jet OLEDB:Database Password=sysadm" Where sysadm is your password. Tip: Don´t use that password :-D Regards

        S Offline
        S Offline
        Smithers Jones
        wrote on last edited by
        #3

        thanks for the quick answer.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups