Question

I'm working on a legacy visual basic application that uses a Jet.OLEDB.4.0 connection string. The user wants to move the application's database (an .mdb file) to a networked location. I was able to allow the user to set the new data file location and everything works, only it is very slow compared to when the db is on the local machine. Microsoft suggests changing the PageTimeout property in the connection string (http://support.microsoft.com/kb/246560/EN-US) and that's where I'm running into issues. Below is the connection string that works but is slow:

Public connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & My.Settings.DataFolderPath & "\Data.mdb;Persist Security Info=True;Jet OLEDB:Database Password=Password;"

When I try to add the PageTimeOut property I get a "Could not find installable ISAM." error from Visual Studio. I'm sure I'm missing something really simple here, and this may not even fix the slow network performance. Here is the connection string that is throwing the error:

Public connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & My.Settings.DataFolderPath & "\Data.mdb;Persist Security Info=True;Jet OLEDB:Database Password=Password;PageTimeout=5000"

I also tried

Public connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & My.Settings.DataFolderPath & "\Data.mdb;Persist Security Info=True;Jet OLEDB:Database Password=Password;Jet OLEDB:PageTimeout=5000"

Any help you could provide would be greatly appreciated.

Was it helpful?

Solution 2

This is probably not a solution to your problem, but as a potential quick-fix, have you tried using a DSN? Once you set it up in Windows ODBC, you can alter your connection string to look like this:

"DSN=MyDSN;PageTimeout=5000;"

Again, this is probably not a solution, but it might be a quick-fix to get you moving in the meanwhile.

OTHER TIPS

The spelling is different:

Jet OLEDB:Page Timeout   // note the space

Full documentation here:

Jet OLEDB:Page Timeout (DBPROP_JETOLEDB_PAGETIMEOUT)

Indicates the number of milliseconds Jet will wait before checking to see whether its cache is out of date with the database file.

Nevertheless, the value cannot be set in a connection string at all, as KB 318161 explains:

The Microsoft OLE DB Provider for Jet includes many custom properties that you can set only after you establish a connection to the database. These provider-specific properties are custom OLE DB session properties. You cannot set these properties in the ADO OLE DB connection string; you must set these properties after the connection is opened.

This error occurs when you specify the following Jet-specific properties in the connection string:

  • Jet OLEDB:ODBC Command Time Out
  • Jet OLEDB:Max Locks Per File
  • Jet OLEDB:Implicit Commit Sync
  • Jet OLEDB:Flush Transaction Timeout
  • Jet OLEDB:Lock Delay
  • Jet OLEDB:Max Buffer Size
  • Jet OLEDB:User Commit Sync
  • Jet OLEDB:Lock Retry
  • Jet OLEDB:Exclusive Async Delay
  • Jet OLEDB:Shared Async Delay
  • Jet OLEDB:Page Timeout
  • Jet OLEDB:Recycle Long-Valued Pages
  • Jet OLEDB:Reset ISAM Stats
  • Jet OLEDB:Connection Control
  • Jet OLEDB:ODBC Parsing
  • Jet OLEDB:Page Locks to Table Lock
  • Jet OLEDB:Sandbox Mode
  • Jet OLEDB:Transaction Commit Mode
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top