Archive: SQL sa info check


SQL sa info check
Once agian I must call upon you guys for help.

My installer needs to check if the sa username and password givin by the user during the install are correct. This needs to happen right after the user enters this info on a custom page and clicks next.

I am running a sql script using nsExec::ExecToStack that connects and checks for a table. This works because it returns if the connection was successful. My problem is that I put this at the end of the custom page section that this needs to happen on and I cant click back, or cancel unless I put in the proper sa and password.

Is there a better way to do this? I know about afrow-UK's buttonevent handler but I cant figure how to get it work with this situation.

thank you


If anyone is unsure of what I am talking about please tell me. I sounded good in my head, but might not have translated well.


You should put the check in the leave callback function of the page. To let the user know something is happening, you can use the Banner plug-in or any of its variants (EBanner, MsXBanner, etc.).


Got it to work. thanks.

Code Example:

page Custom SqlConnect componentsLeave

Function componentsLeave
nsExec::ExecToStack "Osql command"
Pop $0
${If} $0 = 1
MessageBox MB_OK "Unable to connect to SQL Server."
${EndIf}
FunctionEnd

Also how would I