I tried what you suggested but I still can't get it to work. The following is my code. The include file supples the Dsn, Server, Userid, and Password to the database. I get an error message telling me the syntax in wrong in the Select Statement, but I can't find anything wrong with it.
DEFINE VARIABLE ObjRecordset AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE ObjConnection AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE ObjCommand AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE ODBC-Dsn AS CHARACTER NO-UNDO.
DEFINE VARIABLE ODBC-Server AS CHARACTER NO-UNDO.
DEFINE VARIABLE ODBC-Userid AS CHARACTER NO-UNDO.
DEFINE VARIABLE ODBC-Passwd AS CHARACTER NO-UNDO.
DEFINE VARIABLE ODBC-Query AS CHARACTER NO-UNDO.
DEFINE VARIABLE ODBC-Status AS CHARACTER NO-UNDO.
DEFINE VARIABLE ODBC-Reccount AS INTEGER NO-UNDO.
DEFINE VARIABLE ODBC-Null AS CHARACTER NO-UNDO.
DEFINE VARIABLE ODBC-Cursor AS INTEGER NO-UNDO.
DEFINE VARIABLE v-txt AS CHARACTER NO-UNDO.
Create "ADODB.Connection" ObjConnection.
Create "ADODB.RecordSet" ObjRecordSet.
Create "ADODB.Command" ObjCommand.
{R:\WEB\WARE.I}
ObjConnection:Open ( "data source=" + ODBC-DSN + ";server=" + ODBC-SERVER, ODBC-USERID, ODBC-PASSWD, 0 ) NO-ERROR.
If ( error-status:num-messages > 0 ) THEN
DO:
ODBC-STATUS = "Error: Could not establish connection.".
MESSAGE "Error: Could not establish connection.".
PAUSE.
END.
Else
DO:
ODBC-QUERY = "SELECT nextord INTO v-txt FROM sysmstr".
Assign ObjCommand:ActiveConnection = ObjConnection
ObjCommand:CommandText = ODBC-QUERY
ObjCommand:CommandType = 1 /* adCmdText */
ObjConnection:CursorLocation = 3 /* adUseClient */
ObjRecordSet:CursorType = 3 /* adOpenStatic */
ObjRecordSet = ObjCommand:Execute ( output ODBC-NULL, "", 32 ).
MESSAGE v-txt VIEW-AS ALERT-BOX.
END.