M
Mike Brown
Hi folks,
I'm using SQL.REQUEST to query MSDE 2000 With Excel 2002. Normally this
works splendidly, but I have one table that is giving me fits. Using the
following string (or similar):
=SQL.REQUEST("DSN=AF;UID=***;PWD=***;DATABASE=Customers",,2,"SELECT
SourceName
FROM tblSourceRef
WHERE Code="&$P$11&"")
I simply get #N/A returned to the cell. I've tried many, many variations to
get to the bottom of this. The table I'm querying from originally had a
space in the name (tblSourceRef was TBL SourceRef) and I thought maybe that
was my problem, but alas, no. I can use the same worksheet, and the same
basic statement, to collect any other data from any other table in this
database. I have also tried replacing the variable P11 with a static value.
I have used MS Query to query this table, and it has worked fine. I have
also tried the fully qualified names (i.e., "Customers.dbo.tblSourceRef")
but to no avail.
What am I missing here?
The object is to type a customer "Code" into a cell and return the
"SourceName", "Address", and other info one piece at a time into separate
cells.
--
Mike Brown
Process Manager
Asset Forwarding Corp.
EPA-compliant Recycling
DoD 5220.22-M Data Elimination
http://www.assetforwarding.com
I'm using SQL.REQUEST to query MSDE 2000 With Excel 2002. Normally this
works splendidly, but I have one table that is giving me fits. Using the
following string (or similar):
=SQL.REQUEST("DSN=AF;UID=***;PWD=***;DATABASE=Customers",,2,"SELECT
SourceName
FROM tblSourceRef
WHERE Code="&$P$11&"")
I simply get #N/A returned to the cell. I've tried many, many variations to
get to the bottom of this. The table I'm querying from originally had a
space in the name (tblSourceRef was TBL SourceRef) and I thought maybe that
was my problem, but alas, no. I can use the same worksheet, and the same
basic statement, to collect any other data from any other table in this
database. I have also tried replacing the variable P11 with a static value.
I have used MS Query to query this table, and it has worked fine. I have
also tried the fully qualified names (i.e., "Customers.dbo.tblSourceRef")
but to no avail.
What am I missing here?
The object is to type a customer "Code" into a cell and return the
"SourceName", "Address", and other info one piece at a time into separate
cells.
--
Mike Brown
Process Manager
Asset Forwarding Corp.
EPA-compliant Recycling
DoD 5220.22-M Data Elimination
http://www.assetforwarding.com