Re: Stored Procedure to Connect a DBF File
From: John Bell (jbellnewsposts_at_hotmail.com)
Date: 10/25/04
- Next message: Brandon Campbell: "Re: Double Data Entry"
- Previous message: Johny: "Problem with execution"
- In reply to: Prabhat: "Re: Stored Procedure to Connect a DBF File"
- Next in thread: Prabhat: "Re: Stored Procedure to Connect a DBF File"
- Reply: Prabhat: "Re: Stored Procedure to Connect a DBF File"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 25 Oct 2004 12:21:07 +0100
Hi
http://www.connectionstrings.com/ shows the connection string for a
Foxpro/DBF file, you just need to plug that into the information given in
the sp_addlinkedserver documentation in books online. Once you have created
the linked server you can use four part naming syntax to reference it as
part of the select_statement in a declare cursor statement (also documented
with examples in books online).
You can only pass the file location if you use dynamic SQL, but then
OPENROWSET would probably be a better option. You may then also have
problems with scope and be forced to make all the code dynamic.
John
"Prabhat" <not_a_mail@hotmail.com> wrote in message
news:uJaoq9nuEHA.1616@TK2MSFTNGP10.phx.gbl...
> Hi John,
>
> Thanks for reply. Can U give me an example of Linked Server and Opening
the
> records from a DBF file and after the Records (dbf) one by on using loop -
> So that for each record I can check the DB (SQL) for some Comparisions?
>
> And Can't I Pass the Path as Dynamic to the Function / T-SQL Block /
Stored
> procedure and then I will use the Linked Server?
>
> Thanks
> Prabhat
>
>
> "John Bell" <jbellnewsposts@hotmail.com> wrote in message
> news:O#g$FRnuEHA.1712@TK2MSFTNGP14.phx.gbl...
> > Hi
> >
> > If the file/location is going to be constant then a linked server may be
> the
> > better option, alternatively DTS may be an alternative rather than
trying
> to
> > battle with sp_OA*.
> >
> >
> > John
> >
> > "Prabhat" <not_a_mail@hotmail.com> wrote in message
> > news:Of7QeHnuEHA.2608@TK2MSFTNGP11.phx.gbl...
> > > Hi John,
> > >
> > > Thanks for reply.
> > >
> > > I just wanted to read the records with in the DBF file from Stored
> > > procedure - To perform some Action in SQL Server Table.
> > >
> > > I Don't know which is the Best Way : 1) Using Linked Server - As per
AI
> > > (or ) 2) Using ADO Connection etc.?
> > >
> > > Thanks
> > > Prabhat
> > >
> > >
> > > "John Bell" <jbellnewsposts@hotmail.com> wrote in message
> > > news:#A5OjHPuEHA.1008@tk2msftngp13.phx.gbl...
> > > > Hi
> > > >
> > > > I am not sure why you would want to do this, but you should be able
to
> > use
> > > > sp_OA... procedures as documented in Books Online. The examples in
> Books
> > > > Online are mainly SQLDMO but you should be ok with ADODB such as in
> > > > http://tinyurl.com/6pb35
> > > >
> > > > John
> > > >
> > > > "Prabhat" <not_a_mail@hotmail.com> wrote in message
> > > > news:eG6O4sNuEHA.1292@TK2MSFTNGP10.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > Can I Open a ADO Recordset or ADO Connection from within the
Stored
> > > > > Procedure Like in VB Script?
> > > > >
> > > > > Thanks
> > > > > Prabhat
> > > > >
> > > > >
> > > > > "Al" <Al@discussions.microsoft.com> wrote in message
> > > > > news:AA49E2D7-0CBF-4055-9E31-F2C606EC3812@microsoft.com...
> > > > > > Hi,
> > > > > >
> > > > > > i've never tried it, but you might be able to create a Linked
> Server
> > > to
> > > > > the
> > > > > > file, after setting up an ODBC connection to it. The stored
> > procedure
> > > > will
> > > > > > then be to query the Linked Server.
> > > > > >
> > > > > > There are also the OPENROWSET and OPENDATASOURCE Transact-SQL
> > > commands,
> > > > > > which give you access to OLE DB datasources.
> > > > > >
> > > > > > DTS gives you access to dBase, and might be suitable for what
you
> > want
> > > > to
> > > > > > achieve.
> > > > > >
> > > > > > "Prabhat" wrote:
> > > > > >
> > > > > > > Hi All,
> > > > > > >
> > > > > > > Can I Connect to a DBF File and read the Records / Loop
through
> > the
> > > > > records
> > > > > > > of DBF file using / with in the Stored Procedure?
> > > > > > >
> > > > > > > Like in VB we Open as ADO Connection to Connect and a
Recordset
> To
> > > > Open
> > > > > etc.
> > > > > > >
> > > > > > > Thanks
> > > > > > > Prabhat
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: Brandon Campbell: "Re: Double Data Entry"
- Previous message: Johny: "Problem with execution"
- In reply to: Prabhat: "Re: Stored Procedure to Connect a DBF File"
- Next in thread: Prabhat: "Re: Stored Procedure to Connect a DBF File"
- Reply: Prabhat: "Re: Stored Procedure to Connect a DBF File"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|