can i open passward protect mbd file from vb 6 with shell commad or any othe commad
i tried with opencurentdatabase but my aceess window dose not maximize autometicaly any help plz......

Recommended Answers

All 5 Replies

thanks but this will not help me
i want to run my application through vb6 your code is only open mbd file

just clear this out :-

do you want to open your .mdb file in Microsoft Access when you click on a button in your vb6 program?

if yes, then you can try this code :-

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
ShellExecute Me.hwnd, "Open", [B]"c:\mydatabase.mdb"[/B], vbnullstring, vbnullstring, vbMaximizedFocus
End Sub

replace the Bold part with your database path.

regards
Shouvik

your right but my mbd file is password protect and application ask for password when i clikc vb button is thier any parameter i can pass with open command so i can run application without password screen

you have to provide the password manually for your database if you use shellexecute to open the file from your application.

but if you wish to open the database (more techinal term is --> "Connecting to Database") which is password protected then you can do this from your application. the password can be given in to the connectionstring to access the database without making your system to prompt for the password.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.