Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Connection Problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01054056
Message ID:
01054075
Views:
20
Try
DRIVER=SQL Server;SERVER=DSERVER3;database=Euro_Mig_subset;uid=sa;pwd=
BTW, It's a security hole to have sa account w/o password.




>There is no password on the database. Here's the error I'm getting now:
>
>The error:
>"Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sa'.
>
>My conn string:
>DRIVER=SQL Server;SERVER=DSERVER3;database=Euro_Mig_subset;uid=sa;pwd='sa'
>
>
>Here's my updated code:
>
>
>HIDDEN PROCEDURE _SQLConnect
>	
>LOCAL bRetVal, iErrNo, sErrMsg, aErrInfo[1]
>bRetVal = TRUE
>	
>WITH This
>	
>  ** Suppress ODBC error dialog
>  SQLSETPROP(0, "DispWarnings", .F.)
>
>  ** Suppres login dialog
>  SQLSETPROP(0, "DispLogin", 3)
>
>  ** Attempt to connect to the database
>  ._iConnHandle = SQLSTRINGCONNECT(._sSqlConnStr)
>
>  ** If not connected...
>  IF ._iConnHandle < 0
>	
>    ** Get the error information
>    AERROR(aErrInfo)
>    iErrNo	= aErrInfo[1]
>    sErrMsg	= aErrInfo[2]
>			
>    ** Format the error message
>    .sMessage = "Unable to connect to SQL database" + CHR(13)+;
>                "Error " + TRANSFORM(iErrNo) + CHR(13)+;
>                sErrMsg
>
>    ** Turn on the class's error flag
>    .bErrorOccured = TRUE
>		
>    ** Set the function return value to false
>    bRetVal = FALSE
>		
>  ENDIF
>
>ENDWITH	
>	
>RETURN bRetVal
>
>ENDPROC
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform