database security

hog

Well-known member
Joined
Mar 17, 2003
Messages
984
Location
UK
I havent bother with setting password on databases before and am giving it a go now, but get an error message:

"cannot find installable ISAM"

this was my connection string before setting the password:

Code:
gconnConnection = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\carl\My Documents\Sol\rs.mdb;Persist Security Info=False")

And this is it including the password being pased to the string:

Code:
gconnConnection = ("Provider=Microsoft.Jet.OLEDB.4.0;Database password=" & Me.txtPassword.Text & ";Data Source=C:\Documents and Settings\carl\My Documents\Sol\rs.mdb;Persist Security Info=False")

all help gratefully received :)
 
Code:
        Dim Connection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db3.mdb;Jet OLEDB:Database Password="your password";User ID=Admin;Persist Security Info=True"


eg :
Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Connection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db3.mdb;Jet OLEDB:Database Password=dynamic_sysop;User ID=Admin;Persist Security Info=True"
        Dim Command As String = "SELECT * FROM Table1"
        OpenAccessFile(Connection, Command)
    End Sub

    Private Sub OpenAccessFile(ByVal strConnection As String, ByVal strCommand As String)
        Try
            Dim objDbConnection As New OleDbConnection(strConnection)

            objDbConnection.Open() ///open a new connection.

            Dim objCommand As New OleDbCommand(strCommand, objDbConnection)
            Dim objAdaptor As OleDbDataAdapter
            objAdaptor = New OleDbDataAdapter(objCommand)
            Dim objDataSet As New DataSet()
            objAdaptor.Fill(objDataSet, "Table1")
            DataGrid1.DataSource = objDataSet.Tables("Table1") ///fill a datagrid with the recordset

            objDbConnection.Close()
            objCommand.Dispose()
            objAdaptor.Dispose()
            objDataSet.Dispose()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
 
grrrr at how the vb code function messes up code :mad:
Dim Connection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db3.mdb;Jet OLEDB:Database Password=password here;User ID=Admin;Persist Security Info=True"

see if this shows :-\
 
Doh!

Code:
gconnConnection = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\carl\My Documents" & _
                           "\Sol\rs.mdb;Jet OLEDB Database Password=" & Me.txtPassword.Text & _
                           "User ID=Admin;Persist Security Info=True")

still results in "Could not find installable ISAM":(
 
you need a : between OLEDB and Database ( it wont show up in here cuz it thinks its an icon
Code:
        Dim strConnect As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C : \db3.mdb;Jet OLEDB : Database Password=myPassword;User ID=Admin;Persist Security Info=True"
without the space between OLEDB : Database
 
Back
Top