Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Access by VB with Crystal Reports

Status
Not open for further replies.

Diogo

Technical User
Mar 22, 2001
143
0
0
PT
Hello,

I have a problem that i had put a password in my database(Access 2000), and now i can't get the information to my reports(Crystal Reports). If i go directly to Crystal Reports, he ask me by the password, and i see my data, but in VB it opens and close it in a instant.

Is there any way to put the password in my aplication VB to acess the data from Access2000 by Crystal Reports object?.

Thanks any way.

P.S.-Sorry my English.
 
Here's something that may work for ya...

DBEngine.SystemDB = SysDB$
DBEngine.DefaultPassword = Pwd$
DBEngine.DefaultUser = User$

On Error GoTo GetPswd
Set AktuellDB = OpenDatabase(DatabaseName$)

Exit Function

GetPswd:
If ctr% = 0 Then
ctr% = 1
frmPassword.Show 1
DBEngine.DefaultPassword = Pwd$
Unload frmPassword
Resume
ElseIf ctr% = 1 Then
ctr% = 2
If MsgBox("Password may have been wrong - check CapsLock and try again!", vbYesNo) = vbNo Then End
frmPassword.Show 1
DBEngine.DefaultPassword = Pwd$
Unload frmPassword
Resume
Else
MsgBox Error$(Err)
Exit Function
End If

/Cy
 
Sorry, but i only could see this just now.

So i don´t have tried it yet.

I go to try this but i thing this isn't what i want, because the user don´t know the password.

Thanks any way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top