Author: Grigore Dolghin
Posted: 2009-05-01 at 17:16:53
I am sorry, my mistake. Guess that's what happens when one talks from
(bad) memory.
You are creating the connection using SQLSTRINGCONNECT() or
SQLCONNECT(). Both commands have a lSharable parameter which, if is
.T., allows multiple CAs to share the same connection.
In order to achieve this you should create the connection and store
the handle in a public variable or (better) a property of a
permanently visible object, such as _Screen.
_Screen.AddProperty("ConnectionHandle")
_Screen.ConnectionHandle = SQLCONNECT("myDNSName",.T.)
or
_Screen.AddProperty("ConnectionHandle")
_Screen.ConnectionHandle = SQLSTRINGCONNECT("ConnectionStringHere",.T.)
To set the cursoradapter classes to use the previously created
connection, open them in class designer, right click, builder, and
check "Use existing connection handle" and enter
_Screen.ConnectionHandle in that textbox.
On Fri, May 1, 2009 at 4:51 PM, Rafael Copquin <rcopquin@ciudad.com.ar> wrote:
> Thank you Grigore
> But I get the message: 'the property is readonly'
> What am I doing wrong?
> Rafael
>
>
> ----- Original Message -----
> From: "Grigore Dolghin" <gdolghin@gmail.com>
> To: <profoxtech@leafe.com>
> Sent: Thursday, April 30, 2009 7:32 PM
> Subject: Re: vfp9 and sql server express
>
>
> Issue the following line somewhere in the beginning of your program
> (before connecting to SQL Server):
>
> SQLSetProp(0,"Shared",.T.)
>
> This will force VFP to force first connection that will be made to be
> shared.
>
>
>
[excessive quoting removed by server]