Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLEXEC and Shared Connection Problems
Message
De
12/11/2004 14:27:46
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP1
Database:
MS SQL Server
Divers
Thread ID:
00960314
Message ID:
00960971
Vues:
8
Hi Bernard,

When the named connection is created using connection string, you are not supposed to pass UID and PASSWORD to the SQLCONNECT. I believe this is documented.

Try:
lnStatementHandle = SQLCONNECT(MyDataBaseConn',.T.)
Thanks,
Aleksey.


>Hi Aleksey ,
>
>Thanks for the reply and the explanation that the 'AllowSimultaneousFetch' property will allow 2 remote views using a shared connection to download rows simultaneously.
>
>This is a nice feature and will cut down on those pesky 'connection is busy' messages.
>
>Could you just explain one more thing to me ?
>
>If I have two remote views using a named shared connection within a dbc and I set the 'AllowSimultaneousFetch' property to True. I can see that when these two views are requerying that they both download simultaneouisly and don't raise 'connection busy' type errors.
>
>Here's the problem : -
>
>If I have a piece of SQL Pass Through and I want it to use the same shared connection as previously set up in my DBC then I should be able to use the SQLCONNECT function to get a statement handle.
>
>Here's my connection statement in the DBC.
>
>
>CREATE CONNECTION "MyDataBaseConn" CONNSTRING 'driver=SQL SERVER;server=(local);uid=USER1;pwd=PASSWORD1;database=MyDataBase'
>
>
>Then I should be able to get a shared statement handle to this connection by doing the following :
>
>
>lnStatementHandle = SQLCONNECT(MyDataBaseConn','USER1','PASSWORD1',.T.)
>
>
>but if I try to do this I always get connection is busy messages even if I do this whilst no data is being requeryed etc.
>
>Am I misunderstanding how the SQLCONNECT function works in this case?
>
>Here's my test program that shows the problem :-
>
>Many Thanks for the help, Bernard.
>
>
>CLEAR
>CLOSE DATABASES ALL
>DELETE DATABASE REMOTE
>CREATE DATABASE REMOTE
>CREATE CONNECTION "MyDataBaseConn" CONNSTRING 'driver=SQL SERVER;server=(local);uid=USER1;pwd=PASSWORD1;database=MyDataBase'
>
>CREATE SQL VIEW Test REMOTE CONNECTION MyDataBaseConn SHARE AS SELECT * FROM SOMELARGETABLE
>
>DBSETPROP('Test','view', 'AllowSimultaneousFetch',.T.)
>DBSETPROP('Test','view', 'fetchasneeded', .F.)
>DBSETPROP('Test','view', 'fetchsize', 100)
>DBSETPROP('Test', 'View','ShareConnection', .T.)
>
>******** Open The First View *********
>USE test NODATA
>
>* Problem Arises Here, I always get a "connection is busy message"
>* Even though I'm checking to see if the connection is free via a SQLGETPROP('ConnectBusy') Call
>
>IF NOT SQLGETPROP(CURSORGETPROP('ConnectHandle','Test'), "ConnectBusy")
>   lnSQLPassThroughHandle = SQLCONNECT('MyDataBaseConn','USER1','PASSWORD1',.T.)
>ENDIF
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform