Discussion:
Add SQL Server views to Cursor Adapter
(too old to reply)
Ana María Bisbé York
2004-11-24 11:39:56 UTC
Permalink
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 using
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,

Ana
www.amby.net
www.PortalFox.com
Anders Altberg
2004-11-24 20:15:56 UTC
Permalink
Ana
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)]

oDB.Open(oDB.ConnectionString)
oRs=oDB.Execute('select * from "Sales by Category"')
oCA=Createobject('CursorAdapter')
oCA.DataSourceType='ADO'
oca.Alias='Sales by Category'
llOk= oCA.CursorFill( lUseCursorSchema, lNoData, nOptions, oRS)

If llOk
Browse Last &&Nowait
ELSE
MESSAGEBOX('No go with '+oRs.DataSource)
Endif
*****************


-Anders
Post by Ana María Bisbé York
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 using
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,
Ana
www.amby.net
www.PortalFox.com
Ana María Bisbé York
2004-11-25 09:28:41 UTC
Permalink
Thanks, Anders
Post by Anders Altberg
Ana
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)]
oDB.Open(oDB.ConnectionString)
oRs=oDB.Execute('select * from "Sales by Category"')
oCA=Createobject('CursorAdapter')
oCA.DataSourceType='ADO'
oca.Alias='Sales by Category'
llOk= oCA.CursorFill( lUseCursorSchema, lNoData, nOptions, oRS)
If llOk
Browse Last &&Nowait
ELSE
MESSAGEBOX('No go with '+oRs.DataSource)
Endif
*****************
-Anders
Post by Ana María Bisbé York
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
using
Post by Ana María Bisbé York
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,
Ana
www.amby.net
www.PortalFox.com
Loading...