Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL to detect replication
Message
De
16/08/2007 09:09:16
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL to detect replication
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01248496
Message ID:
01248496
Vues:
109
Hi all

I've found a few ways to detect that a particular replication is in place, but the ones I found don't work. The one I came up with on my own works, but involves checking for an error from the backend. The inelegance bugs me. I'm living with that for now.

It seems to me the best thing would be to call sp_helppublication. The docs say pass it a found parameter and check that parameter for the result.

I've tried the online examples but can't seem to get the found result back.

Here's the syntax from the docs.

sp_helppublication [ [ @publication = ] 'publication' ]
[ , [ @found=] found OUTPUT]
[ , [ @publisher = ] 'publisher' ]

So theoretically
lnFound = 23456
lcSQL = "exec sp_helppublication 'mypublication',?@lnFound"
if sqlexec(m.lnHnd,m.lcSQL)<0
  aerror(laError)
endif
?lnFound
should return 1 if found and 0 if not, but lnFound always has 23456 after. I don't get an error, just no lnFound.

Further, how does one phrase the exec to name the parameters and pass them at the same time? Is the following right?

exec sp_helppublication @publication = ?lcPublication, @found = ?@lnFound OUTPUT

I've done this kind of thing before, but it's not working. Anybody see what I'm missing?

Thanks
Répondre
Fil
Voir

Click here to load this message in the networking platform