Discussion:
SQL Server 2000.
(too old to reply)
sp
2003-07-22 23:48:58 UTC
Permalink
We use VFP8 on WinXP and SQL Server 2000.

From our workstation we have established ODBC Connection to the SQL Server.
We have multiple databases in the SQL Server.
When we use SQLEXEC command to run a query, how do we refer to a particular
database's table?
Or, do we have to establish individual ODBC connection for each database in
the SQL Server?

sp
EFGroup
2003-07-23 05:13:09 UTC
Permalink
heya sp .
typically use an individual odbc connection in the form of a system DSN.
you should be able to make a dsn-less connection string, as well - totally
independent of a system dsn .

and the sqlexec does not care - it relies on what you set up for the
connection handle -
which DOES care about the database name .. [sqlconnect()]

you got you MSDN library installed ?? its fairly well documented in there
...
regards [Will]

--
-----------------------------------
Wililam Sanders / Electronic Filing Group
MCSD/MCDBA/MSDN ISV [vfp/sql]
Post by sp
We use VFP8 on WinXP and SQL Server 2000.
From our workstation we have established ODBC Connection to the SQL Server.
We have multiple databases in the SQL Server.
When we use SQLEXEC command to run a query, how do we refer to a particular
database's table?
Or, do we have to establish individual ODBC connection for each database in
the SQL Server?
sp
EFGroup
2003-07-23 05:22:17 UTC
Permalink
sp -
eh - belay my last ..
i just tested my own code [thanks Fred]
and per Fred's stuff -
you can do 'sqlexec(lhConn,"Use DatabaseName")
followed up with 'sqlexec(lhConn, sp_favorite_sql_Code_Here)

mondo regards [Will]

--
-----------------------------------
Wililam Sanders / Electronic Filing Group
MCSD/MCDBA/MSDN ISV [vfp/sql]
Post by sp
We use VFP8 on WinXP and SQL Server 2000.
From our workstation we have established ODBC Connection to the SQL Server.
We have multiple databases in the SQL Server.
When we use SQLEXEC command to run a query, how do we refer to a particular
database's table?
Or, do we have to establish individual ODBC connection for each database in
the SQL Server?
sp
Fred Taylor
2003-07-23 06:57:28 UTC
Permalink
Right, the connection is more geared to which server you're talking to, you
can change the database.
--
Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.
Post by EFGroup
sp -
eh - belay my last ..
i just tested my own code [thanks Fred]
and per Fred's stuff -
you can do 'sqlexec(lhConn,"Use DatabaseName")
followed up with 'sqlexec(lhConn, sp_favorite_sql_Code_Here)
mondo regards [Will]
Post by sp
We use VFP8 on WinXP and SQL Server 2000.
From our workstation we have established ODBC Connection to the SQL
Server. We have multiple databases in the SQL Server.
When we use SQLEXEC command to run a query, how do we refer to a
particular database's table?
Or, do we have to establish individual ODBC connection for each
database in the SQL Server?
sp
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.502 / Virus Database: 300 - Release Date: 7/18/2003
sp
2003-07-23 15:18:21 UTC
Permalink
Thanks,

sp
"Fred Taylor" <***@mvps.org> wrote in message news:***@TK2MSFTNGP11.phx.gbl...
Right, the connection is more geared to which server you're talking to, you
can change the database.


--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.
Post by EFGroup
sp -
eh - belay my last ..
i just tested my own code [thanks Fred]
and per Fred's stuff -
you can do 'sqlexec(lhConn,"Use DatabaseName")
followed up with 'sqlexec(lhConn, sp_favorite_sql_Code_Here)
mondo regards [Will]
Post by sp
We use VFP8 on WinXP and SQL Server 2000.
From our workstation we have established ODBC Connection to the SQL
Server. We have multiple databases in the SQL Server.
When we use SQLEXEC command to run a query, how do we refer to a
particular database's table?
Or, do we have to establish individual ODBC connection for each
database in the SQL Server?
sp
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.502 / Virus Database: 300 - Release Date: 7/18/2003

Loading...