Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL to detect replication
Message
From
16/08/2007 09:09:16
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL to detect replication
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01248496
Message ID:
01248496
Views:
108
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
Reply
Map
View

Click here to load this message in the networking platform