Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DAO to ADO - Connection 'Open' question

Status
Not open for further replies.

Blackshark

Programmer
May 7, 2002
48
GB
Hi all,

I am running through changing all my DAO code to ADO. I have managed to remove all the help files from my laptop and my Office 2K disks are in the British postal system since I left them at another office.

Q1. The Connection object, cnn.Open "Provide=Microsoft.Jet.OLEDB.4.0;" & "Data Source=.\Northwmind.mdb;"

How do I open a local table, ie. that is in my current database?

Q2. If I open a connection and set it at Shared, Read Only. Am I allowing others to make changes while I can only read the data or am I setting the table to read only while I have the connection open?

Q3. The Recordsource object now allows me to 'adOpenForwardOnly' and 'adLockReadOnly'. Again, the 'adLockReadOnly' sounds useful but is it locking the actual table to read only for all other users or just my connection?


Sorry if these are rather basic level queries!

Regards Tim
 
I am not clear on what you are trying to do. To use the current database in a connection.

Dim rs as New ADODB.Recordset
dim mysqlstring as string
mysqlstring = "Select * from mytable"

rs.Open mysqlstring, CurrentProject.Connection, adOpenStatic, adLockOptimistic
 
Q2/Q3.
The lock only affects you. A readonly lock is easier to obtain from the op system, you should always use it if you don't want to change data
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top