IonicWind Software

IWBasic => Database => Topic started by: Pip1957 on June 02, 2008, 08:44:56 AM

Title: Database with password protect
Post by: Pip1957 on June 02, 2008, 08:44:56 AM
Hi, Is it possible to create an mdb database with password protection in EB. Thanks
Title: Re: Database with password protect
Post by: LarryMc on June 02, 2008, 10:03:35 AM
I'm almost positive that it is possible but I just don't know the specific string.

Larry
Title: Re: Database with password protect
Post by: JoaoAfonso on June 04, 2008, 10:26:20 AM
I am after this too... there must be a way for sure.
Title: Re: Database with password protect
Post by: Bruce Peaslee on June 04, 2008, 02:26:44 PM
I have Access on my machine, so setting the password is easy. This works to open a password protected database where the password is "test":


OPENCONSOLE
Def pdb as pointer
pdb = dbConnect("Microsoft Access Driver (*.mdb)",GETSTARTPATH + "db1.mdb","PWD=test")
if (pdb = null)
   print "Connection failed"
ELSE
   PRINT "Connection successful"
   DBDISCONNECT(pdb)
ENDIF
DO:UNTIL INKEY$ <> ""
CLOSECONSOLE
END

Title: Re: Database with password protect
Post by: JoaoAfonso on June 05, 2008, 01:58:11 AM
Hmm... was so easy, afterall. I mean, after reading this, I checked EB help, and in dbconnect help, the example shows exactly how to do it. Thanks, Peaslee. At least I have not paied much attention to help files, once again.
Title: Re: Database with password protect
Post by: Bruce Peaslee on June 05, 2008, 08:11:30 AM
The part I can't get is how to set the password when you create the db file in code. I use Access for most database applications because it makes it easy to create the file with sample data.