FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO Open Question
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
ADO Open Question
Posted: Fri Jan 16, 2009 07:36 PM

All,

I want to open an ado connection to an access database using the adModeShareExclusive mode (12). Can someone give me an example for doing this?

This is what I'm using now:

oConn := CREATEOBJECT( "ADODB.Connection" )
oConn:Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+cDataSource)

cDataSource is the path and name of my .mdb file. The above works fine. I can get the mode with oConn:Mode, which returns 16. However I cannot find the correct syntax to specify or set the mode.

Thanks,
Randal

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: ADO Open Question
Posted: Fri Jan 16, 2009 10:57 PM
Probably you are trying to set Mode property when the connection is open. From MSDN:

You can set the Mode property only when the Connection object is closed.


EMG
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
Re: ADO Open Question
Posted: Tue Jan 20, 2009 04:32 PM

Enrico,

Thanks, that helps.

Randal

Continue the discussion