PRB: ODBC Error IM002 (0): Data Source Not Found...ID: Q112479
|
When you are trying to connect to a server with a DBConnect() command, the following error message is displayed:
ODBC error IM002 (0): [Microsoft][ODBC DLL] Data source not found and no default driver specified
This error could be caused by one of the following situations:
you will receive a negative number for the handle, and after calling DBError(), you will receive the error message.handle=DBConnect('wrong_name','sa','')
handle=DBConnect('test','sa','')\
Syntax of DBConnect()DBConnect(<Data source name>,<User identifier>,<Password>, <Connection string>)-or-
Although many ODBC drivers don't require a connection string, some do. If you include a connection string, FoxPro passes the connection string to the ODBC driver. For more information, see your ODBC driver documentation.
To reproduce the problem using SQL Server:
The server name will vary depending upon the network and the actual name that the server's administrator has given the server.Data Source Name: test Description: test Server: REDDFOXX
SET LIBRARY TO SYS(2004)+"fpsql.fll" PUBLIC errval PUBLIC errmsg PUBLIC handle errval=0 errmsg=' ' sourcename= 'wrong_name' && This should have been && sourcename='test' 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: FoxDos FoxWin IM002 ODBC CK errmsg err msg
Keywords : kb3rdparty kbcode kberrmsg kbnetwork FxtoolCk
Version : 2.50 2.50a 2.50b | 2.50 2.50a 2.
Platform : MS-DOS WINDOWS
Issue type :
Last Reviewed: July 29, 1999