Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
English
SQL Connection Problem
Message
General information
Fórum:
Visual FoxPro
Category:
Programação, sintaxe e comandos
Miscellaneous
ID da thread:
01054056
ID da mensagem:
01062796
Views:
25
Got it. Thanks!

>It should be
>sqlconnstring="DRIVER=SQL Server;SERVER=(local);database=Northwind;uid=sa"
>
>
>>I had this working, then my eval copy of SQL ran out and I had to uninstall and
>>reinstall.
>>
>>Now, I'm getting:
>>"Connectivity error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
>>
>>My conn string is:
>>sqlconnstring=DRIVER=DRIVER=SQL Server;SERVER=(local);database=Northwind;uid=sa
>>
>>
>>
>>
>>>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
>>>>
>>>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Responder
Mapa
View

Click here to load this message in the networking platform