Re: Add SQL Server views to Cursor Adapter

From: Anders Altberg (x_pragma_at_telia.com)
Date: 11/24/04

  • Next message: Ana María Bisbé York: "Re: Add SQL Server views to Cursor Adapter"
    Date: Wed, 24 Nov 2004 21:15:56 +0100
    
    

    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

    "Ana María Bisbé York" <ambyNOSPAM@telefonica.net> wrote in message
    news:#xhhTph0EHA.804@TK2MSFTNGP12.phx.gbl...
    > 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
    >
    >


  • Next message: Ana María Bisbé York: "Re: Add SQL Server views to Cursor Adapter"

    Relevant Pages

    • Active Sync and SQL CE
      ... I am trying to develop an application that has sales ... I have a central SQL server that has ... server that hosts SQL directly. ... replication and RDA needs IIS. ...
      (microsoft.public.pocketpc.activesync)
    • RDA SubmitSQL and connection pooling
      ... I'm involved with a van sales SQL Server ce application thats virtually ... Most of the vans sync within a 2 hour period and the application has had ... profiler reveals that SubmitSQL opens a new connection for every statement ...
      (microsoft.public.sqlserver.ce)
    • MSDE as prototype
      ... I have reporting responsibilities in a big company within a marketing ... department and use DB2 queries and Access then excel to create sales and ... profit reports for 3 different sales divisions. ... We have a "SQL server group" ...
      (microsoft.public.sqlserver.msde)
    • Re: containstable across columns
      ... SELECT LastName, FirstName, Title, Notes from Employees ... all 9 rows that contain Fuller OR Sales ... SQL Server 7.0 KB article "294809 FIX: ...
      (microsoft.public.sqlserver.fulltext)