Re: open a passwordsaved database ??





Michael B. Johnson schrieb:

You would use it with ADO (Add a project reference to Microsoft Active-X Data
Objects 2.1 Library).


oConn would be an ADODB.Connection object.


I don't own a license to MS Access 2003, I still use MS Access '97. Inside of my
MS Access '97 database, I might create a module or place this sample inside the
code for a form. I don't need a password, because once I've opened MS Access,
I'm pretty sure that CurrentDb contains my connection to the database without
needing to supply the password again:

<air code>
Public Sub Sample()
Dim db As Database
Dim sSQL As String
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Table1", dbOpenTable)
Do Until rs.EOF
Debug.Print rs.Fields(0).Value
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Sub
</air code>
_______________________
Michael B. Johnson


Hallo Michael and all others,

I've tryed and it is like wrote yesterday, I need to open the database not the table.
The err.description is: "Objekt erforderlich" (object needed) err.number: 424 in the line:"Set db = CurrentDb"
My problem is to open the "CurrentDb".
It is not important, witch version the database is (the same result with access 2000)
I've tested a lot of variations (that gives me eg. the err.numbers: 3055 or 3421), but I doe'nt found the right.
Have anybody an idea??
And once more sorry, I have only the german description and my translation may be not right, thatswhy I give you also the err.number.

-------------------------------------------------
Uwe Gutsche



.



Relevant Pages

  • Re: open a passwordsaved database ??
    ... Michael B. Johnson schrieb: ... need to ignore instructions that have to do with ADO solutions. ... * You can use a split database with DAO linked tables with a DSN. ...
    (comp.lang.basic.visual.misc)
  • Re: open a passwordsaved database ??
    ... Michael B. Johnson schrieb: ... * Are you opening the database from within code inside MS Access VBA, ... accessing the MS Access database from VB Code? ...
    (comp.lang.basic.visual.misc)
  • Re: conflicting object names in sql server 2000
    ... A login name of michael in the connection string does not mean the user name ... access to a particular database. ... My guess is that the login michael is dbo on one database and not dbo on ...
    (microsoft.public.sqlserver.server)
  • RE: How to set column-options in "create table" with ODBC Driver ?
    ... > Also i have the problem that the empty character string is not allowed by ... You cannot use this DDL query "as is" in Access 2000. ... "Michael" wrote: ... you'll need to change the database settings. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Appending a field to a table -AND- accessing a split back-end
    ... Your link "Tony Toew's article" was also helpful. ... Michael ... > Allen Browne - Microsoft MVP. ... >> I am working in the front end of a split database and I want to modify the ...
    (microsoft.public.access.modulesdaovba)