Page 1 of 1

Can NB dbPro open an Access Database exclusive?

PostPosted: Mon Oct 13, 2014 10:04 pm
by Enigman
I would like to eliminate the appearance of the ".ldb" file when I open my access database with my program. I have heard that opening the database in exclusive mode will not create the ".ldb" file. My program will never share the data or at least it is not intended to share. Is it possible for dbPro to open the database in exclusive mode?

Failing that, is there a way to redirect the location of the ".ldb" file so I can bury it in an obscure location?

I don't want to provide a hint that my database type is Access. The ".ldb" is nicely branded with an MS Access icon that gives it away.

Thanks.

Re: Can NB dbPro open an Access Database exclusive?

PostPosted: Tue Oct 14, 2014 8:40 am
by dpayer
Enigman wrote:I would like to eliminate the appearance of the ".ldb" file when I open my access database with my program. I have heard that opening the database in exclusive mode will not create the ".ldb" file. My program will never share the data or at least it is not intended to share. Is it possible for dbPro to open the database in exclusive mode?

Failing that, is there a way to redirect the location of the ".ldb" file so I can bury it in an obscure location?

I don't want to provide a hint that my database type is Access. The ".ldb" is nicely branded with an MS Access icon that gives it away.

Thanks.


Would setting the attribute to hidden do what you want?

attrib +h filename.ldb

Re: Can NB dbPro open an Access Database exclusive?

PostPosted: Tue Oct 14, 2014 10:14 am
by Neosoft Support
You can open an Access database in exclusive mode by using dbpOpenDatabase instead of dbpOpenAccessDatabase. The dbpOpenDatabase action allows you to specify a custom connection string used to open the database. For example, the following will open an Access database in exclusive mode:

dbpOpenDatabase "ID" "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\path\yourdatabase.mdb;Mode=Share Exclusive"

Replace the file name (in red) with the name of your database file.

More information about MS Access connection strings can be found here:

http://www.connectionstrings.com/access/

Re: Can NB dbPro open an Access Database exclusive?

PostPosted: Tue Oct 14, 2014 10:57 am
by Enigman
For example, the following will open an Access database in exclusive mode:

dbpOpenDatabase "ID" "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\path\yourdatabase.mdb;Mode=Share Exclusive"

How sensitive is the Microsoft.Jet.OLEDB.4.0 part? What if they are on XP and maybe they don't have 4.0 is there a way to know or downshift to an earlier version or is that even what the 4.0 means? Also I use a password plus encryption. I didn't see much on the referenced article about encryption. Without that I may up introducing more problems than I solve. Looking at the article this seems like a world of slippery spagetti.

I think I would have to check for errors opening and then downshift to dbpOpenAccessDatabase in case the database didn't open, but I'm not sure if I would be able to reliably trap that.

???

Re: Can NB dbPro open an Access Database exclusive?

PostPosted: Tue Oct 14, 2014 11:27 am
by dpayer
Enigman wrote:
For example, the following will open an Access database in exclusive mode:

dbpOpenDatabase "ID" "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\path\yourdatabase.mdb;Mode=Share Exclusive"

How sensitive is the Microsoft.Jet.OLEDB.4.0 part? What if they are on XP and maybe they don't have 4.0 is there a way to know or downshift to an earlier version or is that even what the 4.0 means? Also I use a password plus encryption. I didn't see much on the referenced article about encryption. Without that I may up introducing more problems than I solve. Looking at the article this seems like a world of slippery spagetti.

I think I would have to check for errors opening and then downshift to dbpOpenAccessDatabase in case the database didn't open, but I'm not sure if I would be able to reliably trap that.

???


There is a way to check for the installed ODBC drivers via VB script (this link refrences another which may help http://stackoverflow.com/questions/1113 ... -using-vba)

You can look for the most common versions and then use the discovered one in your connection script.

Re: Can NB dbPro open an Access Database exclusive?

PostPosted: Wed Oct 15, 2014 10:40 am
by Neosoft Support
How sensitive is the Microsoft.Jet.OLEDB.4.0 part?


DBPro's built-in OpenAccessDatabase action uses "Microsoft.Jet.OLEDB.4.0" in the connection string it generates, and we haven't had any problems on XP.

Re: Can NB dbPro open an Access Database exclusive?

PostPosted: Wed Oct 15, 2014 11:03 am
by Enigman
DBPro's built-in OpenAccessDatabase action uses "Microsoft.Jet.OLEDB.4.0" in the connection string it generates, and we haven't had any problems on XP.

Okay, so then am I safe adding my normal password parameter? And it won't have a problem with an Access encrypted database?

Thanks.

Re: Can NB dbPro open an Access Database exclusive?

PostPosted: Thu Oct 16, 2014 10:10 am
by Neosoft Support
Okay, so then am I safe adding my normal password parameter? And it won't have a problem with an Access encrypted database?


That's what DBPro uses internally when connecting to MS Access databases, so I believe that it's safe to use and will work with encrypted databases. Of course, for mission critical applications, there is no substitute for testing as much as possible.