=SetConnString('Connect1', 'SERVER='+cSQLServer_na ; ,'uid='+a_UserInfo[4], 'pwd='+a_UserInfo[5]) h_Connect1=SQLCONNECT('Connect1', .t.) =SetConnString('Connect1', 'SERVER=','uid=','pwd=') ****************** FUNCTION SetConnString LPARAMETERS c_Conn_na, c_Parm1, c_Parm2, c_Parm3, c_Parm4, c_Parm5 ; , c_Parm6, c_Parm7, c_Parm8 *c_Conn_na the name of the connection whose string to set *Connection strings parameters to set, eg 'UID=Kamil' * Example of calling this function * SetConnString('Connect1','uid='+a_UserInfo[4],'pwd='+a_UserInfo[5]) * Example of a connect string * DRIVER=SQL Server;Server=OvspsPipe;uid=kamil; * pwd=KamilPwd;APP=Microsoft® Visual FoxPro®;WSID=KAMIL; * DATABASE=PL;Network=DBMSSOCN;Address=ovsps,1433 PRIVATE n_Count, c_ConnString, c_BeforeMatch ; , c_MatchAfter, n_Pointer, x_R1, c_R2, c_Parm l_Result=.T. && Return value c_ConnString=.F. && Connection String c_ConnString=DBGETPROP(c_Conn_na,'Connection','ConnectString') IF VARTYPE(c_ConnString)='L' && if still logical RETURN .F. ENDIF FOR n_Count = 1 TO 8 c_Parm=EVALUATE('c_Parm'+TRANSFORM(n_Count)) IF VARTYPE(c_Parm)='L' OR EMPTY(c_Parm) LOOP ENDIF c_Parm=ALLTRIM(c_Parm) n_Pointer=ATC('=',c_Parm) IF n_Pointer<1 l_Result=.F. LOOP ENDIF x_R1=LEFT(c_Parm,n_Pointer) && eg UID= c_R2=SUBSTR(c_Parm,n_Pointer+1) && eg KAMIL * setting the connection string parameter n_Pointer=ATC(x_R1,c_ConnString) IF n_Pointer<1 l_Result=.F. LOOP ENDIF c_BeforeMatch=LEFT(c_ConnString,n_Pointer-1) c_MatchAfter=SUBSTR(c_ConnString,n_Pointer) c_ConnString=c_BeforeMatch+c_Parm n_Pointer=ATC(';',c_MatchAfter) IF n_Pointer>0 c_MatchAfter=SUBSTR(c_MatchAfter,n_Pointer) c_ConnString=c_ConnString+c_MatchAfter ENDIF ENDFOR IF NOT l_Result WAIT 'Not able to form a connection string' WINDOW ENDIF IF APPLICATION.STARTMODE>0 && Design mode=0 DBSETPROP(c_Conn_na,'Connection','DispLogin',3) && no login dialog ENDIF RETURN DBSETPROP(c_Conn_na,'Connection','ConnectString',c_ConnString) AND l_Result ************************************If the user doesn't know the password, he can't connect to the database, hence he can not use the RV to modify the data.