querying ado and two password protected access database

querying ado and two password protected access database

Post by Berkda » Wed, 13 Mar 2002 16:35:59



Hi,
i have two password protected access database
1- oda.mdb     ;password:np
tables
    eczane : this table include pharmacist's infos
            fields :
                    ID
                    Name
                    Address
                    Tel              etc.....

2-Makbuz.mdb   ;password:np
table
       invoice : this table include invoices data
                fields:
                    PharmacistID
                    invoiceNo
                    TotalValue

i want to list invoices data and pharmacist's infos with datagrid but i have
a problem.
Because this mdb files password protected and when i want querying this
database's tables with ado i'm getting this error message:
"runtime error -2147467259(80004005)
not a valid password"

can i connect two password protected access database with ado connection and
recordset objet?
or is there another way?
Note: this database protected microsoft jet password. no user id and
password, only database password.

this code running before databases are not password protected. when i assign
a password this mdb files this code give a error message.

With Cnn
        If .State = 1 Then .Close
        .CursorLocation = adUseServer
        .ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source="
                                        "c:\data\makbuz.mdb;Jet
OLEDB:Database Password=np"
        .Open
    End With
        With Cmd
                .CommandType = adCmdText
                .CommandText = "select top 50 invoiceno as [Invoice
No],invoicedate as [Invoice Date],PharmacistID as
                [Pharmacist ID],Pharmcyname as [Pharmacy
Name],PharmacistName as [Pharmacist Name],TotalValue
                as Tutar from   invoice,c:\data\oda.eczane where
ID=PharmacistID  and invoicedate>=#01/01/2002# order
by invoiceno desc"
               Set .ActiveConnection = Cnn
       End With

            With Rst
                .CursorLocation = adUseServer
                .LockType = adLockPessimistic
                .CursorType = adOpenDynamic
                .Open Cmd      'this line generate an error message.
            End With

thank you...

 
 
 

querying ado and two password protected access database

Post by Val Mazu » Wed, 13 Mar 2002 21:32:31


Hi,

To open connection with password protected Access database
you need to use next kind of connection string. But I am
anot sure if you can do that with two password protected
databases using same connection. I have never tried that

MyConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=PathToMDB;Jet OLEDB:Database Password=MDBPassword;"

Val

Quote:>-----Original Message-----
>Hi,
>i have two password protected access database
>1- oda.mdb     ;password:np
>tables
>    eczane : this table include pharmacist's infos
>            fields :
>                    ID
>                    Name
>                    Address
>                    Tel              etc.....

>2-Makbuz.mdb   ;password:np
>table
>       invoice : this table include invoices data
>                fields:
>                    PharmacistID
>                    invoiceNo
>                    TotalValue

>i want to list invoices data and pharmacist's infos with
datagrid but i have
>a problem.
>Because this mdb files password protected and when i want
querying this
>database's tables with ado i'm getting this error message:
>"runtime error -2147467259(80004005)
>not a valid password"

>can i connect two password protected access database with
ado connection and
>recordset objet?
>or is there another way?
>Note: this database protected microsoft jet password. no
user id and
>password, only database password.

>this code running before databases are not password

protected. when i assign
Quote:>a password this mdb files this code give a error message.

>With Cnn
>        If .State = 1 Then .Close
>        .CursorLocation = adUseServer
>        .ConnectionString

= "provider=Microsoft.Jet.OLEDB.4.0;data source="
Quote:>                                        "c:\data\makbuz.md
b;Jet
>OLEDB:Database Password=np"
>        .Open
>    End With
>        With Cmd
>                .CommandType = adCmdText
>                .CommandText = "select top 50 invoiceno
as [Invoice
>No],invoicedate as [Invoice Date],PharmacistID as
>                [Pharmacist ID],Pharmcyname as [Pharmacy
>Name],PharmacistName as [Pharmacist Name],TotalValue
>                as Tutar from  

invoice,c:\data\oda.eczane where

- Show quoted text -

Quote:>ID=PharmacistID  and invoicedate>=#01/01/2002# order
>by invoiceno desc"
>               Set .ActiveConnection = Cnn
>       End With

>            With Rst
>                .CursorLocation = adUseServer
>                .LockType = adLockPessimistic
>                .CursorType = adOpenDynamic
>                .Open Cmd      'this line generate an
error message.
>            End With

>thank you...

>.


 
 
 

querying ado and two password protected access database

Post by Berkda » Wed, 13 Mar 2002 21:59:26


hi Val,

i can connect to the mdb file.
but i can't querying two passworded database in one query(command string).
.CommandText = "select top 50 invoiceno as [Invoice No],invoicedate as
[Invoice Date],PharmacistID as" &_
                            "[Pharmacist ID],Pharmcyname as [Pharmacy
Name],PharmacistName as [Pharmacist Name]," &_
                            "TotalValue as Tutar from
invoice,c:\data\oda.eczane where ID=PharmacistID  and
invoicedate>=#01/01/2002# order by invoiceno desc"

.....

            With Rst
                .CursorLocation = adUseServer
                .LockType = adLockPessimistic
                .CursorType = adOpenDynamic
                .Open Cmd      'this line generate an  error message.
            End With

when i run this code i see error messages in the ".open cmd" line.

thank you for reply.


Quote:> Hi,

> To open connection with password protected Access database
> you need to use next kind of connection string. But I am
> anot sure if you can do that with two password protected
> databases using same connection. I have never tried that

> MyConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=PathToMDB;Jet OLEDB:Database Password=MDBPassword;"

> Val

> >-----Original Message-----
> >Hi,
> >i have two password protected access database
> >1- oda.mdb     ;password:np
> >tables
> >    eczane : this table include pharmacist's infos
> >            fields :
> >                    ID
> >                    Name
> >                    Address
> >                    Tel              etc.....

> >2-Makbuz.mdb   ;password:np
> >table
> >       invoice : this table include invoices data
> >                fields:
> >                    PharmacistID
> >                    invoiceNo
> >                    TotalValue

> >i want to list invoices data and pharmacist's infos with
> datagrid but i have
> >a problem.
> >Because this mdb files password protected and when i want
> querying this
> >database's tables with ado i'm getting this error message:
> >"runtime error -2147467259(80004005)
> >not a valid password"

> >can i connect two password protected access database with
> ado connection and
> >recordset objet?
> >or is there another way?
> >Note: this database protected microsoft jet password. no
> user id and
> >password, only database password.

> >this code running before databases are not password
> protected. when i assign
> >a password this mdb files this code give a error message.

> >With Cnn
> >        If .State = 1 Then .Close
> >        .CursorLocation = adUseServer
> >        .ConnectionString
> = "provider=Microsoft.Jet.OLEDB.4.0;data source="
> >                                        "c:\data\makbuz.md
> b;Jet
> >OLEDB:Database Password=np"
> >        .Open
> >    End With
> >        With Cmd
> >                .CommandType = adCmdText
> >                .CommandText = "select top 50 invoiceno
> as [Invoice
> >No],invoicedate as [Invoice Date],PharmacistID as
> >                [Pharmacist ID],Pharmcyname as [Pharmacy
> >Name],PharmacistName as [Pharmacist Name],TotalValue
> >                as Tutar from
> invoice,c:\data\oda.eczane where
> >ID=PharmacistID  and invoicedate>=#01/01/2002# order
> >by invoiceno desc"
> >               Set .ActiveConnection = Cnn
> >       End With

> >            With Rst
> >                .CursorLocation = adUseServer
> >                .LockType = adLockPessimistic
> >                .CursorType = adOpenDynamic
> >                .Open Cmd      'this line generate an
> error message.
> >            End With

> >thank you...

> >.

 
 
 

1. ado and password protected two access database

Hi.,
I have password protected two access database and i want to querying this
two databases tables.
i want to get saved invoices list within two database.

and i wrote this code.
This code running before passworded. but when i assign password for two
database i'm getting this error;
"runtime error -2147467259(80004005)
not a valid password"

first database's name is makbuz.mdb table's name is makbuz
second database's name is oda.mdb  table's name is eczane

can i write a password in the command object or is there another way do it?
thanks,

    With Cnn
        If .State = 1 Then .Close
        .CursorLocation = adUseServer
        .ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source="
& Yollar & "\makbuz.mdb;Jet OLEDB:Database Password=np"
        Debug.Print .ConnectionString
        .Open
    End With
        With Cmd
                .CommandType = adCmdText
                .CommandText = "select top 50 ubmakbuzno as [Makbuz
No],ubmakbuztarihi as [Makbuz Tarihi],ekodu as
[Eczane Kodu],eadi as [Eczane Ady],eeczaciadi as [Eczacy Ady],ubmakbuztutari
as Tutar,ubkullanicikodu as                         Kullanici from
ustbilgi," & Yol & "\data\oda.eczane where ekodu=ubeczanekodu and ubmakbuzno
like '" &                         Makno & "%' " & Suz & " and ubmakbuztarihi
               Set .ActiveConnection = Cnn
       End With

            With Rst
                .CursorLocation = adUseServer
                .LockType = adLockPessimistic
                .CursorType = adOpenDynamic
                .Open Cmd
            End With

2. dbschema Q - does it lock table?

3. Using ADO with Encrypted/Password Protected Access databases

4. Extended Stored Procedures....HELP!!!!

5. Howto connect to a password protected access-database by using ADO

6. Distributing an ADO application & Access 2000 Database problem

7. Accesing two different SQL Server databases that are password protected

8. TrueGrid,Database & Listbox

9. how do i access a password protected MS-ACCESS db without the password

10. Access a password protected access database.

11. Accessing a password protected Access 97 database using the Jet Engine

12. VB6 accessing simple password protected Access database problems

13. VB 4.0 (32-bit) accessing password protected Access 7.0 database