> I am trying to create a secure Jet Workspace. My OS is Win95 however I'm
> programming in VB4 - 16bit for Access 2.0 (user has Win3.1).
> The problem is either VB or my program is not correctly validating the user
> ID and password against the system.mda. I can start Access and login with
> same user & password using what I think is the same system.mda. I've
> even tried the sample app VISDATA to connect to the system.mda and attempt
> to create a workspace, and that has the same problem.
> Can someone tell me what I might be doing wrong or what to look for.
> My syntax is something like
> ==========================
> Sub Login(User,Pswd)
> Dim ws as workspace
> ' The .Ini specifies the SystemDB path
> DBEngine.IniPath = "C:\msacc20.ini"
> Set ws = DBEngine.CreateWorkspace("MyWs",User, Pswd)
> =============================
> I get the run-time error message 3029 : Not a valid account name or
> password
> - Brad
I think your problem is that you need to set your Tools/References to
include the VB DOA 2.5/3.0 Compatibility Library.
My problem is a little more frustrating, I think.
Here's my code:
Private Sub Form_Load()
Dim MyWorkSpace As Workspace, MyDB As Database, MyRecordset As
Snapshot, MySQL As String
' The old VB3 way
'SetDataAccessOption 1, "E:\MYAPPS\MYPROGRAM\MYPROGRAM.INI"
'SetDefaultWorkspace "myusername", "mypassword"
' The new improved VB4 way
DBEngine.DefaultUser = "myusername"
DBEngine.DefaultPassword = "mypassword"
DBEngine.IniPath = "E:\MYAPPS\MYPROGRAM\MYPROGRAM.INI"
Set MyWorkSpace = DBEngine.Workspaces(0)
I get the following error on opening the Workspace:
Run-time Error '3028'
Can't start your application. The system database is missing or is
opened exclusively by another user.
My MYPROGRAM.INI file looks like this:
[Options]
SystemDB=E:\MYAPPS\MYPROGRAM\system.mda
UtilityDB=E:\MYAPPS\MYPROGRAM\utility.mda
Both files are where they should be, so the system database is NOT
missing; and there doesn't appear to be anybody else sitting next to me,
so what gives?
When I rem out the DefaultUser and DefaultPassword lines I get the
following message:
Run-time Error '3112'
Record(s) can't be read. No Read Data permission on 'MyTableName'.
This is the same error I get when I try to open the 'MyTableName' table
using the Data Manager Add-in.
Obviously something is going wrong here. Any ideas?
Ed Yachimiak