Q115995
When you are trying to connect to an SQL Server machine with a DBConnect() function, you receive the following error message from DBError():
ODBC error 01000 (-1): [Microsoft][ODBC SQL Server Driver][dbnmp3] ConnectionOpen (sopen()).
The error is caused by an incorrect server name in the ODBC Driver Manager's Setup application in the Control Panel.
The following steps and code reproduce the problem using an SQL Server:
Data Source Name: test
Description: test
Server: WRONG_SRV
NOTE: WRONG_SRV is a nonexistent server name; if the correct server name
appears in the ODBC Driver Manager's Setup for the driver, the example
below will return a valid connection.
SET LIBRARY TO SYS(2004)+"fpsql.fll"
PUBLIC errval
PUBLIC errmsg
PUBLIC handle
errval=0
errmsg=' '
sourcename= 'test ' && This is the source name specified
&& in the ODBC Driver Manager.
user= 'sa' && This is your user ID for SQL
&& Server.
passwd='' && Password for the user ID on the
&& line above.
********CONNECT
handle=DBConnect(sourcename,user,passwd)
IF handle > 0
WAIT WINDOW 'Successfully Connected' nowait
ELSE
error=DBError(0,@errmsg,@errval)
WAIT WINDOW STR(error)+' '+STR(errval)+' '+errmsg
ENDIF
Additional query words: FoxWin 2.50 2.60 ODBC CK 01000 errmsg err msg
Keywords :
Issue type : kbprb
Technology : kbAudDeveloper kbFoxproSearch kbFoxPro250 kbFoxPro250a kbFoxPro250b
|
Last Reviewed: March 10, 2000 |