I'm not sure what shared connection in this case is. You can either keep connection open the way you showed in your code or you can open it every time you need to access SQL Server and close right after.
>I'm considering creating a class to handle SQL.
>
>The class will handle connection, disconnection and pass queries
>and commands through to SQL.
>
>I'm a little unsure how shared connections work. How would I implement
>shared connections in this class? Maybe a method like:
>
>
>PROCEDURE CreateConnection(iHandle AS Integer) AS Boolean
>
> IF PCOUNT() = 0
>
> ** Form SQL connection string using sServer, sDatabase properties and connect
> sSqlConnStr = "DRIVER=SQL Server;SERVER=" + .cServer + ";Database=" + .sDatabase
>
> .iConnHandle = SQLSTRINGCONNECT(sSqlConnStr)
>
> ELSE
>
> ** Use the handle passed in
> .iConnHandle = SQLCONNECT(iHandle)
>
> ENDIF
>
>ENDPROC
>
--sb--