Accessing data from a Access 97 database

Accessing data from a Access 97 database

Post by Conny Danielsso » Sun, 26 Jul 1998 04:00:00



Hi,

I am a new VB-developer and are hving some truble accessing data from a password
protected database. Since I'm new in this enviroment I find the online help a
bit hard to find my way in. When I open the VB form I get "Invalid Password" and
no records are fetched to my form. How do I give the database password, I would
prefer to do it when i start my VB-application.

 
 
 

Accessing data from a Access 97 database

Post by CHARLES G MA » Mon, 27 Jul 1998 04:00:00


I think this is what you want (DAO)

         Set myDB = DBEngine.Workspaces(0).OpenDatabase _
         (Database, False, False, ";PWD=ThePassword")

Hope this helps
CM


>Hi,

>I am a new VB-developer and are hving some truble accessing data from a
password
>protected database. Since I'm new in this enviroment I find the online help
a
>bit hard to find my way in. When I open the VB form I get "Invalid
Password" and
>no records are fetched to my form. How do I give the database password, I
would
>prefer to do it when i start my VB-application.


 
 
 

Accessing data from a Access 97 database

Post by Douglas Taylo » Thu, 30 Jul 1998 04:00:00


On Error GoTo cmdOK_Click_Error
Dim myDB As Database

DBEngine.SystemDB = gstrDBPath & "\myproject.mdw"
DBEngine.DefaultUser = txtUserName
DBEngine.DefaultPassword = txtPassword
Set myWork = DBEngine.CreateWorkspace("myproject", txtUserName, txtPassword,
dbUseJet)
DBEngine.Workspaces.Append myWork
Set myDB = myWork.OpenDatabase(gstrDBPath & gstrDBName)
Screen.MousePointer = vbHourglass
gstrUserName = txtUserName
gstrPassword = txtPassword
MDIMain.Show

cmdOK_Click_Exit:
  Exit Sub
cmdOK_Click_Error:
  Select Case Err.Number
    Case 3029, 3030, 3031
       MsgBox "Invalid User name or Password"
       Me.txtUserName = ""
       Me.txtPassword = ""
       Me.txtUserName.SetFocus
    Case Else
       ErrorBox Err, "cmdOK_Click"
       Resume cmdOK_Click_Exit
  End Select


>Hi,

>I am a new VB-developer and are hving some truble accessing data from a
password
>protected database. Since I'm new in this enviroment I find the online help
a
>bit hard to find my way in. When I open the VB form I get "Invalid
Password" and
>no records are fetched to my form. How do I give the database password, I
would
>prefer to do it when i start my VB-application.

 
 
 

1. SQL data access by Access 97 and Access 2000

We have a SQL database that we connect to with Access 97.  Queries and forms
written in Access 97.

We have a number of clients who use Access 2000 - and we've written the same
queries and forms for that version in Access 2000.

It may seem like a dumb question - apologies - but I assume it is perfectly
okay to add data to SQL using both versions of Access, users accessing SQL
with those 2 verions at the same time?

Thanks,
Chris

2. Java and XML for SQL Server 2000

3. Accessing Delphi (Paradox?) data using Microsoft Access 97

4. Can't see SQL resource

5. Using a Data Control in VB5 accessing a user-level secure Access 97 DB

6. Why should I prefer using ODBC data sources?

7. Accessing MS Access 97 data from Delphi 3

8. ADODC and existing database connection

9. Moving data from Access 2 to Access 97 in VB6

10. MS-Access 97 to SQL Server to MS-Access 97

11. Exporting Access 97 data to Excel 97

12. Converting Access 97 Database to Access 2