Re: Add SQL Server views to Cursor Adapter
From: Anders Altberg (x_pragma_at_telia.com)
Date: Wed, 24 Nov 2004 21:15:56 +0100
You can use the views name just like a tablename, In this example it's the
view "Sales By Category" in the SQL Server demo Northwind database
LOCAL lUseCursorSchema, lNoData, nOptions
STORE .F. to lUseCursorSchema, lNoData
nOptions = -1
LOCAL llOk As Boolean, oDB As ADODB.Connection
PUBLIC oCA as CursorAdapter,oRs As ADODB.Recordset
oDB = Createobject("ADODB.Connection")
oDB.ConnectionString = ;
[Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist ;
Security Info=False;Initial Catalog=Northwind;Data Source=(local)]
oRs=oDB.Execute('select * from "Sales by Category"')
oca.Alias='Sales by Category'
llOk= oCA.CursorFill( lUseCursorSchema, lNoData, nOptions, oRS)
Browse Last &&Nowait
MESSAGEBOX('No go with '+oRs.DataSource)
"Ana María Bisbé York" <ambyNOSPAM@telefonica.net> wrote in message
> Hi all,
> My name is Ana Ma. Bisbé. I'm writing you from Madrid, Spain.
> I'm trying to add some views from a SQL Server Data Base into CA. I'm
> the CA Builder.
> In the second tab, Data access I've chosen Build for Select Command, and
> then I saw that there aren't included views, just tables.
> How should I do? Is any choice, except typing of course?
> Best regards,