Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Design Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01063063
Message ID:
01063163
Vues:
12
The docs for SQLCONNECT states:

Parameters
nStatementHandle
Specifies that a new statement handle be created for the underlying shared connection that
is represented by nStatementHandle. The new statement handle uses the settings provided
from nStatementHandle instead of using the default settings.


I took this to mean that you can create concurrent connections that share the same
handle?









>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
>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform