Re: SQL Server Native Client error handling.

2011-10-10 Thread Alan Bourke
Yes DispLogin is the one thanks. On Wednesday, October 05, 2011 12:37 PM, "Fred Taylor" wrote: > If I set both DISPLOGIN and DISPWARNINGS, I don't have a problem even if > the > SQL SERVER doesn't really exist. Yes DispLogin is the one thanks. -- Alan Bourke alanpbourke (at) fastmail (dot)

Re: SQL Server Native Client error handling.

2011-10-05 Thread Fred Taylor
If I set both DISPLOGIN and DISPWARNINGS, I don't have a problem even if the SQL SERVER doesn't really exist. SQLSETPROP(0, "DISPWARNINGS", .f. ) SQLSETPROP(0, "DISPLOGIN", 3 ) nH = Sqlstringconnect([DRIVER=SQL Server Native Client 10.0;SERVER=DEVSERVERxxx\DEV;Trusted_Connection=Yes;DATABASE=Repor

Re: SQL Server Native Client error handling.

2011-10-05 Thread Stephen Russell
On Wed, Oct 5, 2011 at 11:08 AM, Alan Bourke wrote: > Nope - you can only CATCH TO a variable which gets created as the VFP > 'Exception' type if an error happens - you can't make it an > SQLException. And anyway the SQL Native Client stuff doesn't fire the > CATCH. What it needs is the ability t

Re: SQL Server Native Client error handling.

2011-10-05 Thread Fred Taylor
Do you normally display the logon screen? Maybe if you have that turned on it wants you to see any error for that. Fred On Wed, Oct 5, 2011 at 9:11 AM, Alan Bourke wrote: > Thanks Fred - that has no effect so these mustn't come under the > 'warnings' heading. > > On Wednesday, October 05, 201

Re: SQL Server Native Client error handling.

2011-10-05 Thread Alan Bourke
Thanks Fred - that has no effect so these mustn't come under the 'warnings' heading. On Wednesday, October 05, 2011 8:47 AM, "Fred Taylor" wrote: > Sounds like you may have warning messages turned on? Thanks Fred - that has no effect so these mustn't come under the 'warnings' heading. -- Alan

Re: SQL Server Native Client error handling.

2011-10-05 Thread Alan Bourke
On Wednesday, October 05, 2011 10:37 AM, "Stephen Russell" wrote: > > You can do a try catch in VFP. That's the first thing I did. > > Can't you define what you are catching and allow a different catch > block by exception type? Nope - you can only CATCH TO a variable which gets created as

Re: SQL Server Native Client error handling.

2011-10-05 Thread Fred Taylor
Sounds like you may have warning messages turned on? Before you try to make your connection: SQLSETPROP(0, "DISPWARNINGS", .F. ) m.nH = SQLSSTRINGCONNECT(... Fred On Wed, Oct 5, 2011 at 8:01 AM, Alan Bourke wrote: > I'm connecting to SQL Server 2008 from VFP9 SP2 using the SQL Server > Nati

Re: SQL Server Native Client error handling.

2011-10-05 Thread Stephen Russell
On Wed, Oct 5, 2011 at 10:23 AM, Alan Bourke wrote: > > > On Wednesday, October 05, 2011 10:07 AM, "Stephen Russell" > wrote: >> >> try >> catch(SQLException sex) >> messagebox.show(sex.Message) > > Um .. thanks, but that looks like C# whereas I need to do that in VFP :) > --

Re: SQL Server Native Client error handling.

2011-10-05 Thread Alan Bourke
On Wednesday, October 05, 2011 10:07 AM, "Stephen Russell" wrote: > > try > catch(SQLException sex) > messagebox.show(sex.Message) Um .. thanks, but that looks like C# whereas I need to do that in VFP :) -- Alan Bourke alanpbourke (at) fastmail (dot) fm _

Re: SQL Server Native Client error handling.

2011-10-05 Thread Stephen Russell
On Wed, Oct 5, 2011 at 10:01 AM, Alan Bourke wrote: > I'm connecting to SQL Server 2008 from VFP9 SP2 using the SQL Server > Native Client 10. I'm using SqlStringConnect() > > Which all works fine, except when the connection fails for whatever > reason. When this happens the client throws up a big