Click to See Complete Forum and Search --> : how to connect to access?


dmeikle
October 5th, 2001, 02:12 AM
okay, I'm a SQL Server user, using an access database for a client's web project since the host does not support SQL Server. I have this error coming up:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.

using an oledb connection like this one:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & PathToDB

I've also tried a DSN, but no luck....help!!!

Shiv Kumar G.M.
October 5th, 2001, 02:58 AM
Check out that the database is opened, if opened close it.

check out the driver also.

Regards,
Shivakumar G.M.

Iouri
October 5th, 2001, 07:11 AM
It does not matter if db is open. You can connect to the open database.

Iouri Boutchkine
iouri@hotsheet.com

ramayansunil
October 6th, 2001, 02:19 AM
Hi,
If the data base file is opened at the time of running of the program the above error will come. Try connecting to database through program by closing the data base file
all the best
sunil

Robert Moy
October 6th, 2001, 09:38 PM
Hello:

Is the table and database password and userid protected? You might need to get the password and userid to get in.

Good Luck

dmeikle
October 8th, 2001, 03:24 AM
I am finding now that my connection string works (without changing it) if I do a simple:

rs.open query, conn, adopenforwardonly, adlockreadonly

but if I do a rs.open query,conn, adopenkeyset,adlockbatchoptimistic
with a clientside cursor it gives me this error. I usually use this as a standard db method, since it allows me to use a global function:
RetrieveRS(Query as string,optional PageSize as integer,optional PageNum as integer) as adodb.recordset

that all of my methods can call to have it return a disconnected recordset so that the whole recordset is returned in one call to the database, rather than row by row.

Can I not do this with access?

vincentma
October 9th, 2001, 03:21 AM
I find all freshmen here. All you need to do is a small change like this :
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & PathToDB & "'"

good luck! Remember to give me some good comments :).