Re: Changing a view's connection



USE MyView CONNSTRING cConnectionstring | nStatementHandle

CONNSTRING cConnectionString | nStatementHandle

Specifies a connection string for the ODBC data source. The
cConnectionString parameter can represent parameters normally passed using
either SQLCONNECT( ) or SQLSTRINGCONNECT( ). The nStatementHandle parameter
specifies a memory variable representing an existing statement handle from
an existing connection.

When you use cConnectionString, Visual FoxPro passes the connection string
to the remote view that you specify with SQLViewName, which then uses the
connection string to connect to the specified data source instead of using
any previously defined connection string. Passing an empty string ("")
displays the ODBC Data Source dialog box and makes it possible for the user
to select a data source.

-Anders




"Andy Trezise" <andy@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uAB%23Z6WGIHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
I have a number of views in my database that connect to SQL tables via a
connection (also defined in the database).

Is it possible to point the vew to another connection without having to
recreate it?

If I rename the original connection the view still seems to 'remember' the
parameters and link to the same SQL table etc.

I assume this daa s held in the database but it doesn't look as though I
can alter it (even is I 'use' the .DBC file).



.



Relevant Pages

  • Re: Persistant Data Source in reusable documents
    ... Word cannot find the data source, so it prompts you ... the "database" is the Access .mdb file that contains ... An application such as Word that uses OLE DB to get data usually specifies ... truncates the connection string to 255 characters long. ...
    (microsoft.public.word.mailmerge.fields)
  • MailMerge with SQL Server, OpenDataSource problem
    ... Attaches the specified data source to the active document, ... Microsoft Query file instead of a specifying a data source, ... connection string, and a query string. ...
    (microsoft.public.office.developer.automation)
  • Re: Word cannot find data source problem
    ... The string will be saved either in the connection string, or in the SQLStatement, or split across the two, depending on how Word chose to make the connection. ... Can you tell me where the path to the data source is saved when I do the ... location of a data source into a "database" and a "table". ...
    (microsoft.public.word.mailmerge.fields)
  • Re: OpenDataSource in vba creates an error
    ... if all the connection information is in the Connection string, ... if you are using Integrated Security for SQL Server access, ... > I have a problem connecting to data source in mail merge. ... > I created a datasource through the Select Data Source screen to connect to ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Word cannot find data source problem
    ... "Peter Jamieson" wrote: ... could you tell me if any data source information is stored in my ... >> the database part of the data source's locatoin in a /Connection>> string/, ... Word constructs a connection string ...
    (microsoft.public.word.mailmerge.fields)