Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Design Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01063063
Message ID:
01063160
Views:
9
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform