Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hide invalid sql login password windows while accessing remote server

Status
Not open for further replies.

adcounsel1

Programmer
Jan 27, 2005
46
PK
Dear All

We have inhouse development of a program designed in VFP6. Database is designed in SQL7 and located remotly. Sometime it happen, when our client works on that application it connects remotly to that SQL DB server if due some reason (internet/isp) server is not connected, SQL invalid login password appears which shows the database + DB user name.

My problem is that I want to hide that windows if server is not connected, or is there any way to show customized message window.

Thanks

Hashim
 
Hashim,

How are you connecting to the server? If you are using SQL pass-through, you can user your own dialogue to prompt for the login and password. Then use SQLCONNECT() to send these to the server:

lnConn = SQLCONNECT('MyDSN', 'LoginName', 'MyPassword')

That way, the user should never see the server's login dialogue.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi,

You can set the connection's .DispLogin property to 3 to prohibit that dialog to show.

Problem is you need to have a connection to set it's property, and that connection may show the dialog :). It's a vicious circle.

Fortunatelly, VFP is smart enough in this.

SQLSETPROP(0,"DispLogin",3) - please notice the connection handle is 0 (zero), will set this setting as a default value for all future connections. IOW, the next try to establish a connection will not show the login dialog.

Hope this helps,

Grigore Dolghin
Class Software
Bucharest, Romania
 
Dear All

I use

handle=sqlc(allt(hnd1),"aero","aero34")

it works fine but whenever some operator run application from workstation and server is down due to some reason, SQL SERVER LOGIN window APPEAR, and it shows the database handle information, which i want to hide or disable.

Dear Grigore Dolghin

I have to set the property via code or it can be done in sql server also. Please expedite
 
whenever some operator run application from workstation and server is down due to some reason, SQL SERVER LOGIN window APPEAR

Try this:

handle=sqlc(allt(hnd1),"aero","aero34")
IF Handle < 0
* Cannot connect to server; display a user-friendly
* message, and come out of the process
ELSE
* Proceed as usual
ENDIF

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks Mike for ur valued suggestion. Ok i have tried this code but my cutome message appears after the sql login window which one i want to hide, pls expedite.

Thanks

Hashim
 
Hi,

have you tried to do what Grigore Dolghin suggested?

SQLSETPROP(0,"DispLogin",3)
handle=sqlc(allt(hnd1),"aero","aero34")

After that, it's IMPORTANT that you don't do any more SQLEXEC etc. if the handle you get back from sqlc (SQLCONNECT) is <= 0, like Mike told you!

Bye, Olaf.
 
Deal Olaf

it works fine. I have try ur code and SQL login dialog dont show but now I got another window message:

connectivity error:[microsoft][ODBC SQL Server Driver][SQL
Server]Login failed for user'aero'

Can I hide this window message also and show my custome message. becoz again it also discloses the connection handle 'aero'.

Thanks

Hashim
 
Deal Olaf

Thanks for the guidence, I have also hide the above mentioned windows message,


connectivity error:[microsoft][ODBC SQL Server Driver][SQL
Server]Login failed for user'aero'

by changing properties in vfp>tools>OPTION and disable show warning messages.

Again Thanks.

Hashim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top