Hello,
I have just started trying to use SQLRDD to connect to our MS SQL server. I have been trying to connect to one of the existing SQL tables and keep getting errors.
This is the sample code I am trying to run.
#include "
sqlrdd.ch"
REQUEST SQLRDD
REQUEST SR_ODBC
PROCEDURE Main()
local cDns := "Driver=SQL Server;DATABASE=UPS;TRUSTED_CONNECTION=Yes;SERVER=devSQL;Description=XHtoSQL;APP=XHtoSQL"
local cActconn := 0
local cComm := ""
local nErr, nPos
local apCode, oSql
local aTables := {}
RddsetDefault("SQLRDD")
SR_AddConnection(CONNECT_ODBC_QUERY_ONLY,cDns)
oSql := SR_GetActiveConnection()
? oSQL
? "Connected to :", SR_GetConnectionInfo(, SQL_DBMS_NAME ), "- Version :", SR_GETCONNECTIONInfo(,SQL_DBMS_VER )
? SR_ExistTable( "UPSCI" )
? SR_Version()
oSQL:exec("select top 2 * from UPSCI",,.f.)
When the exec line runs it produces the error:
Error BASE/1004 Class: 'NUMERIC' has no exported method:
EXEC Arguments: ( [1] = Type: N Val: 1 [2] = Type: C Val: select top 2 8 from UPSCI [3] = Type: U [4] = Type: L Val: .F.)
I could use help determining what I am doing wrong.
Thanks