Showing posts with label table. Show all posts
Showing posts with label table. Show all posts

Friday, March 30, 2012

ODBC Error

I get the following error (from my front-end Access app AND Query Analyzer)
when accessing a particular table. It is a rather large table, ~1,750,000
rows in it. I tried looking through "limitations" in BOL and couldn't find
anything. Is this a server setting or ODBC setting or... ?
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionChe
ckForData
(CheckforData()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection BrokenWhat are you trying to do with that much data? Access isn't designed
to handle scrolling through millions of rows, although you may be
having network issues, as the error message suggests. Restrict the
data fetched with a WHERE clause, or if it's a report, write a stored
procedure and call it through a pass-through query.
--mary
On Thu, 15 Apr 2004 17:03:47 -0700, "Ron Hinds"
<__NoSpam@.__NoSpamramac.com> wrote:

>I get the following error (from my front-end Access app AND Query Analyzer)
>when accessing a particular table. It is a rather large table, ~1,750,000
>rows in it. I tried looking through "limitations" in BOL and couldn't find
>anything. Is this a server setting or ODBC setting or... ?
>[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionCh
eckForData
>(CheckforData()).
>Server: Msg 11, Level 16, State 1, Line 0
>General network error. Check your network documentation.
>Connection Broken
>|||What I'm trying to do is populate a local table (BackOrders) that's actually
used in the form from a server table (SalesDetail). There is a constraint
(WHERE Customer=x AND QtyAvailable>0) but using DAO it still tries to fetch
the entire table. Here is the original SQL (pure Access 97 app):
INSERT INTO BackOrders (InvoiceNumber, InvoiceDate, Part, Price, QtyOrdered,
QtyAvailable, Description) SELECT SalesDetail.InvoiceNumber,
SalesDetail.InvoiceDate, SalesDetail.Part, SalesDetail.Price,
SalesDetail.QtyOrdered, Inventory.QtyAvailable, Inventory.Description FROM
SalesDetail INNER JOIN Inventory ON SalesDetail.Part = Inventory.Part WHERE
SalesDetail.Customer=x AND SalesDetail.QtyOrdered > SalesDetail.QtyShipped
AND Inventory.Qty - Inventory.QtyCommitted > 0 AND SalesDetail.BackOrder > 0
ORDER BY SalesDetail.invoiceDate DESC
Even if this worked as-is with SQL Server (it doesn't - gives the same
error), it would be horribly slow, so I wanted to optimize it by creating a
View of the server tables. But I don't know the value of 'x' (Customer)
until run time. So I used the following DDL to create the View on SQL
Server:
USE Prototype
GO
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_NAME = 'vBackOrder')
DROP VIEW vBackOrder
GO
CREATE VIEW vBackOrder AS
SELECT TOP 100 PERCENT SalesDetail.invoiceNumber, SalesDetail.invoiceDate,
SalesDetail.Part, SalesDetail.Price, SalesDetail.QtyOrdered, Inventory.Qty -
Inventory.QtyCommitted AS QtyAvailable, Inventory.Description
SalesDetail.Customer FROM SalesDetail INNER JOIN Inventory ON
SalesDetail.itemID = Inventory.invItemID WHERE SalesDetail.QtyOrdered >
SalesDetail.QtyShipped AND Inventory.Qty - Inventory.QtyCommitted > 0 AND
SalesDetail.BackOrder > 0 ORDER BY SalesDetail.invoiceDate DESC
GO
I linked vBackOrder in Access then used this DAO code to populate local
table BackOrders:
INSERT INTO BackOrders (InvoiceNumber, InvoiceDate, Part, Price, QtyOrdered,
QtyAvailable, Description) SELECT vBackOrder.InvoiceNumber,
vBackOrder.InvoiceDate, vBackOrder.Part, vBackOrder.Price,
vBackOrder.QtyOrdered, vBackOrder.QtyAvailable, vBackOrder.Description FROM
vBackOrder WHERE vBackOrder.Customer=x
This also gives the same error, as does attempting to open the linked
vBackOrder in Access. I then went to QA and tried just the SELECT portion of
the CREATE VIEW with the same result. To narrow it down, I tried SELECTing *
FROM Inventory - a little slow but no problem. I then tried the same thing
with SalesDetail and again get the same error. I have >300 server tables of
varying sizes in this app. SalesDetail is by far the largest, and it is the
*only* one I get the error on. So I'm assuming it has something to do with
the size.
"Mary Chipman" <mchip@.online.microsoft.com> wrote in message
news:pflv701qqge68qf7u94r6bnetfkb1iuc53@.
4ax.com...
> What are you trying to do with that much data? Access isn't designed
> to handle scrolling through millions of rows, although you may be
> having network issues, as the error message suggests. Restrict the
> data fetched with a WHERE clause, or if it's a report, write a stored
> procedure and call it through a pass-through query.
> --mary
> On Thu, 15 Apr 2004 17:03:47 -0700, "Ron Hinds"
> <__NoSpam@.__NoSpamramac.com> wrote:
>
Analyzer)[vbcol=seagreen]
find[vbcol=seagreen]
>|||DAO is the problem. You're loading the Jet engine and using it for SQL
Server data operations, something it was never designed or optimized
to do. Create a stored procedure instead of a buinch of views. Stored
procedures support parameters and complex logic, and return a
read-only result set which you can use to populate your local table.
Call the stored procedure from a pass-through query where you set the
SQL syntax to something like this in your code (you can use DAO to set
properties of a QueryDef object and execute it):
qdef.SQL = "EXEC myproc 'paramvalue1', val2" etc.
qdef.Execute
Pass-through queries bypass the Jet engine when they're executed and
are the most efficient way of getting back large result sets since all
of the processing takes place on the server, not in Jet. You then
create either an Insert or Update query that selects from your
pass-through query into the local table. When you call the
insert/update query it will automatically execute the pass-through
query to get the records.
-- Mary
Microsoft Access Developer's Guide to SQL Server
http://www.amazon.com/exec/obidos/ASIN/0672319446
On Fri, 16 Apr 2004 17:09:15 -0700, "Ron Hinds"
<__NoSpam@.__NoSpamramac.com> wrote:

>What I'm trying to do is populate a local table (BackOrders) that's actuall
y
>used in the form from a server table (SalesDetail). There is a constraint
>(WHERE Customer=x AND QtyAvailable>0) but using DAO it still tries to fetch
>the entire table. Here is the original SQL (pure Access 97 app):
>INSERT INTO BackOrders (InvoiceNumber, InvoiceDate, Part, Price, QtyOrdered
,
>QtyAvailable, Description) SELECT SalesDetail.InvoiceNumber,
>SalesDetail.InvoiceDate, SalesDetail.Part, SalesDetail.Price,
>SalesDetail.QtyOrdered, Inventory.QtyAvailable, Inventory.Description FROM
>SalesDetail INNER JOIN Inventory ON SalesDetail.Part = Inventory.Part WHERE
>SalesDetail.Customer=x AND SalesDetail.QtyOrdered > SalesDetail.QtyShipped
>AND Inventory.Qty - Inventory.QtyCommitted > 0 AND SalesDetail.BackOrder >
0
>ORDER BY SalesDetail.invoiceDate DESC
>Even if this worked as-is with SQL Server (it doesn't - gives the same
>error), it would be horribly slow, so I wanted to optimize it by creating a
>View of the server tables. But I don't know the value of 'x' (Customer)
>until run time. So I used the following DDL to create the View on SQL
>Server:
>USE Prototype
>GO
>IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
> WHERE TABLE_NAME = 'vBackOrder')
> DROP VIEW vBackOrder
>GO
>CREATE VIEW vBackOrder AS
>SELECT TOP 100 PERCENT SalesDetail.invoiceNumber, SalesDetail.invoiceDate,
>SalesDetail.Part, SalesDetail.Price, SalesDetail.QtyOrdered, Inventory.Qty
-
>Inventory.QtyCommitted AS QtyAvailable, Inventory.Description
>SalesDetail.Customer FROM SalesDetail INNER JOIN Inventory ON
>SalesDetail.itemID = Inventory.invItemID WHERE SalesDetail.QtyOrdered >
>SalesDetail.QtyShipped AND Inventory.Qty - Inventory.QtyCommitted > 0 AND
>SalesDetail.BackOrder > 0 ORDER BY SalesDetail.invoiceDate DESC
>GO
>I linked vBackOrder in Access then used this DAO code to populate local
>table BackOrders:
>INSERT INTO BackOrders (InvoiceNumber, InvoiceDate, Part, Price, QtyOrdered
,
>QtyAvailable, Description) SELECT vBackOrder.InvoiceNumber,
>vBackOrder.InvoiceDate, vBackOrder.Part, vBackOrder.Price,
>vBackOrder.QtyOrdered, vBackOrder.QtyAvailable, vBackOrder.Description FROM
>vBackOrder WHERE vBackOrder.Customer=x
>This also gives the same error, as does attempting to open the linked
>vBackOrder in Access. I then went to QA and tried just the SELECT portion o
f
>the CREATE VIEW with the same result. To narrow it down, I tried SELECTing
*
>FROM Inventory - a little slow but no problem. I then tried the same thing
>with SalesDetail and again get the same error. I have >300 server tables of
>varying sizes in this app. SalesDetail is by far the largest, and it is the
>*only* one I get the error on. So I'm assuming it has something to do with
>the size.
>"Mary Chipman" <mchip@.online.microsoft.com> wrote in message
> news:pflv701qqge68qf7u94r6bnetfkb1iuc53@.
4ax.com...
>Analyzer)
>find
>|||Hi Mary,
BTW I have your book and it is very good. Unfortunately, for this project I
am stuck with Access 97 and the book seems to reference Access 2000 +.
Thanks for your help and that not only works but it is *much* faster! Looks
like I'll be retrofitting all of those Views I created! Thanks again!
Regards,
Ron Hinds
"Mary Chipman" <mchip@.online.microsoft.com> wrote in message
news:c7d280ledkacc75n7ugk5jgd8v7bibuepa@.
4ax.com...
> DAO is the problem. You're loading the Jet engine and using it for SQL
> Server data operations, something it was never designed or optimized
> to do. Create a stored procedure instead of a buinch of views. Stored
> procedures support parameters and complex logic, and return a
> read-only result set which you can use to populate your local table.
> Call the stored procedure from a pass-through query where you set the
> SQL syntax to something like this in your code (you can use DAO to set
> properties of a QueryDef object and execute it):
> qdef.SQL = "EXEC myproc 'paramvalue1', val2" etc.
> qdef.Execute
> Pass-through queries bypass the Jet engine when they're executed and
> are the most efficient way of getting back large result sets since all
> of the processing takes place on the server, not in Jet. You then
> create either an Insert or Update query that selects from your
> pass-through query into the local table. When you call the
> insert/update query it will automatically execute the pass-through
> query to get the records.
> -- Mary
> Microsoft Access Developer's Guide to SQL Server
> http://www.amazon.com/exec/obidos/ASIN/0672319446
> On Fri, 16 Apr 2004 17:09:15 -0700, "Ron Hinds"
> <__NoSpam@.__NoSpamramac.com> wrote:
>
actually[vbcol=seagreen]
fetch[vbcol=seagreen]
QtyOrdered,[vbcol=seagreen]
FROM[vbcol=seagreen]
WHERE[vbcol=seagreen]
SalesDetail.QtyShipped[vbcol=seagreen]
> 0
a[vbcol=seagreen]
SalesDetail.invoiceDate,[vbcol=seagreen]
Inventory.Qty -[vbcol=seagreen]
QtyOrdered,[vbcol=seagreen]
FROM[vbcol=seagreen]
of[vbcol=seagreen]
SELECTing *[vbcol=seagreen]
thing[vbcol=seagreen]
of[vbcol=seagreen]
the[vbcol=seagreen]
with[vbcol=seagreen]
~1,750,000[vbcol=seagreen]
Sockets]ConnectionCheckForData[vbcol=sea
green]
>|||Although the book is for a newer version, the basic concepts remain
the same, and always will, which are: fetch only needed data and
perform as much data processing on the back end. Let the FE do
presentation tasks like formatting, etc. All of the code in the
chapters for linked tables will work pretty much as-is in Access 97.
--Mary
On Mon, 19 Apr 2004 14:08:04 -0700, "Ron Hinds"
<__NoSpam@.__NoSpamramac.com> wrote:

>Hi Mary,
>BTW I have your book and it is very good. Unfortunately, for this project I
>am stuck with Access 97 and the book seems to reference Access 2000 +.
>Thanks for your help and that not only works but it is *much* faster! Looks
>like I'll be retrofitting all of those Views I created! Thanks again!
>Regards,
>Ron Hinds
>
>"Mary Chipman" <mchip@.online.microsoft.com> wrote in message
> news:c7d280ledkacc75n7ugk5jgd8v7bibuepa@.
4ax.com...
>actually
>fetch
>QtyOrdered,
>FROM
>WHERE
>SalesDetail.QtyShipped
>a
>SalesDetail.invoiceDate,
>Inventory.Qty -
>QtyOrdered,
>FROM
>of
>SELECTing *
>thing
>of
>the
>with
>~1,750,000
>Sockets]ConnectionCheckForData
>|||Ron,
Switch to an Access 2002 data project and dump the mdb. You are looking at
a complete rewrite. Access 2002 ADPs are VERY EASY to use. Access linked t
ables create multiple connections and are prone to creating deadlocks and mu
ltitudes of other problems.
Linked tables in Access 97 worked 'OK', linked tables in 2000 and on are not
usable in a production system.
"Ron Hinds" wrote:

> I get the following error (from my front-end Access app AND Query Analyzer
)
> when accessing a particular table. It is a rather large table, ~1,750,000
> rows in it. I tried looking through "limitations" in BOL and couldn't find
> anything. Is this a server setting or ODBC setting or... ?
> [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionC
heckForData
> (CheckforData()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> Connection Broken
>
>

ODBC drivers not listed in SS2005 import wizard

I'm trying to import an RBASE table into SQL Server 2005. In 2000, the RBAS
E
ODBC driver was listed in the drop down list of the import wizard. It is no
t
listed in the 2005 wizard. Is there a fix for this?
Thanks,
MikeTry using the .Net Framework Data Provider for ODBC.
Then enter the DSN or the driver and connection string.
-Sue
On Fri, 26 May 2006 13:29:02 -0700, Mike
<Mike@.discussions.microsoft.com> wrote:

>I'm trying to import an RBASE table into SQL Server 2005. In 2000, the RBA
SE
>ODBC driver was listed in the drop down list of the import wizard. It is n
ot
>listed in the 2005 wizard. Is there a fix for this?
>Thanks,
> Mike|||Thanks Sue...I'll give that a try!
"Sue Hoegemeier" wrote:

> Try using the .Net Framework Data Provider for ODBC.
> Then enter the DSN or the driver and connection string.
> -Sue
> On Fri, 26 May 2006 13:29:02 -0700, Mike
> <Mike@.discussions.microsoft.com> wrote:
>
>

ODBC driver problem occurs on table create

Hi all!

I get the following error when trying to create a table:
[Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server does not exist or access denied.[Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen (Connect()).

I use the same connection for table updates and selects and never have a problem. This only happens on table create. It also only happens on one machine (Win2K with SQL server 2000 Enterprise Edition). I've run this app without getting this problem on at least ten other machines (mostly WinXP, but also a few Win2K).

Any ideas?

nscdDoes the account that you're using have permissions on that SQL Server to create new tables?|||Yes it does.

I've also changed it so that I connect using the sa account, but still get the same problem.

Cheers

nscd|||Hi all

Further investigation has revealed that my client's machine was fairly out of date and installing the latest MDAC patch from MS resolved the problem.

Cheers

nscd

Monday, March 26, 2012

odbc datagrida

Good Day,
I got a table with company details.I am using ODBC to conect to it.

I am writing a windows form application in C# 2005 express edition.The task is to search companies. my code is as below.


OdbcCommand cmd = new OdbcCommand("use company", MyConnection);

cmd.CommandText = "SELECT * FROM employee WHERE Name = ?;"; /****line 3*****/
cmd.Parameters.Add("@.Name", OdbcType.VarChar, 30);
cmd.Parameters["@.Name"].Value = textBox1.Text;
cmd.ExecuteNonQuery();

OdbcDataAdapter datadapter = new OdbcDataAdapter(cmd.CommandText, MyConnection);
DataSet dataset = new DataSet();
datadapter.Fill(dataset,"employee"); /**error line***/

dataGridView1.DataMember="employee";
dataGridView1.DataSource=dataset;


The

above code compiles cleanly but when you run it,it gives a error. the

error statemnet is as below and the line giving error is show above in

coment.


ERROR [07002] [MySQL][ODBC 3.51 Driver][mysqld-5.0.27-community-nt]SQLBindParameter not used for all parameters


When line 3 is replaced by cmd.CommandText = "SELECT * FROM employee;"; the program works. fine.

I can view all employees only.BUT not a specific employee.
the problem looks complex.If some-one can help me out,it would be much appreciated.

Thanx
Rahul SK

msn add:ar_kul@.hotmail.comDo you sure that 'Name' field is exists in this table?

odbc datagrida

Good Day,
I got a table with company details.I am using ODBC to conect to it.

I am writing a windows form application in C# 2005 express edition.The task is to search companies. my code is as below.


OdbcCommand cmd = new OdbcCommand("use company", MyConnection);

cmd.CommandText = "SELECT * FROM employee WHERE Name = ?;"; /****line 3*****/
cmd.Parameters.Add("@.Name", OdbcType.VarChar, 30);
cmd.Parameters["@.Name"].Value = textBox1.Text;
cmd.ExecuteNonQuery();

OdbcDataAdapter datadapter = new OdbcDataAdapter(cmd.CommandText, MyConnection);
DataSet dataset = new DataSet();
datadapter.Fill(dataset,"employee"); /**error line***/

dataGridView1.DataMember="employee";
dataGridView1.DataSource=dataset;


The above code compiles cleanly but when you run it,it gives a error. the error statemnet is as below and the line giving error is show above in coment.

ERROR [07002] [MySQL][ODBC 3.51 Driver][mysqld-5.0.27-community-nt]SQLBindParameter not used for all parameters


When line 3 is replaced by cmd.CommandText = "SELECT * FROM employee;"; the program works. fine.

I can view all employees only.BUT not a specific employee.
the problem looks complex.If some-one can help me out,it would be much appreciated.

Thanx
Rahul SK

msn add:ar_kul@.hotmail.comDo you sure that 'Name' field is exists in this table?
sql

ODBC Data Source to a linked SQL Server

I'd like to set up an ODBC Data Source to a table in a linked SQL
Server, via
my local SQL Server.
When I use the ODBC Data Sources program to set up the ODBC DSN, it
only
shows databases in the local SQL Server, not in the linked one. If I
try typing it in: [NAMEOFLINKEDSERVER].databasename - it tells me that
it is an invalid table.
How can I create an ODBC Data Source which uses a database in the
linked server as its default database?
I've got a similar question. In my case I linked an Oracle database to my
SQL Server 2005 Standard database. I also want to see the tables in the
linked server. I hope someone can answer this for both of us...
Randall Arnold
<listrecv@.gmail.com> wrote in message
news:1137940173.907969.215550@.o13g2000cwo.googlegr oups.com...
> I'd like to set up an ODBC Data Source to a table in a linked SQL
> Server, via
> my local SQL Server.
> When I use the ODBC Data Sources program to set up the ODBC DSN, it
> only
> shows databases in the local SQL Server, not in the linked one. If I
> try typing it in: [NAMEOFLINKEDSERVER].databasename - it tells me that
> it is an invalid table.
> How can I create an ODBC Data Source which uses a database in the
> linked server as its default database?
>

ODBC Data Source to a linked SQL Server

I'd like to set up an ODBC Data Source to a table in a linked SQL
Server, via
my local SQL Server.
When I use the ODBC Data Sources program to set up the ODBC DSN, it
only
shows databases in the local SQL Server, not in the linked one. If I
try typing it in: [NAMEOFLINKEDSERVER].databasename - it tells me that
it is an invalid table.
How can I create an ODBC Data Source which uses a database in the
linked server as its default database?I've got a similar question. In my case I linked an Oracle database to my
SQL Server 2005 Standard database. I also want to see the tables in the
linked server. I hope someone can answer this for both of us...
Randall Arnold
<listrecv@.gmail.com> wrote in message
news:1137940173.907969.215550@.o13g2000cwo.googlegroups.com...
> I'd like to set up an ODBC Data Source to a table in a linked SQL
> Server, via
> my local SQL Server.
> When I use the ODBC Data Sources program to set up the ODBC DSN, it
> only
> shows databases in the local SQL Server, not in the linked one. If I
> try typing it in: [NAMEOFLINKEDSERVER].databasename - it tells me that
> it is an invalid table.
> How can I create an ODBC Data Source which uses a database in the
> linked server as its default database?
>

ODBC Data Source error

As other contributors, all I am trying to do is import data from an ODBC source (spelled 'non-Microsoft data source') into a SQL 2005 table. I can easily do this in SQL 2000 with DTS, but when I use the same DSN in VS 2005 it doesn't work.

I created an integration project, and made a connection in Connection Manager to the DSN and clicked Test Connection. It succeeded, or so it claimed.

Click OK and drag a DataReader Source onto the Data Flow surface Doubleclick it and select the connection manager per above. Note the error: Error at Data Flow Task [DataReader Source[50]]: Cannot acquire a managed connection from the run-time connection manager.

What does that mean? More to the point, how to fix it?

I wonder if you are using an ODBC connection manager? That will not work with the Data Reader Source.

The ODBC connection manager uses native ODBC and can be used with the ExecuteSQL Task.

The DataReader source needs an ADO.Net Connection Manager which can in turn reference a DSN through the ODBC Data Provider for .Net.

Donald Farmer

|||

Donald, thanks for your reply. Clearly I am missing something, though. In the designer, the Execute SQL task is in the toolbox for Control Flow, and the Ole Db Destination task is in the toolbox for Data Flow. There is no task in Data flow that I can find that will map columns from the ODBC source to the OLE DB destination, and there doesn't appear to be a task in Control Flow to do this either.

Again, I am trying to append records from an ODBC table to a SQL 2005 table. The tables have identical column names and equivalent data types. What do I need to do?

Thanks,

Steve

|||

ODBC is supported in the data flow by the Data Reader source adapter. I think the original problem may have been that you were trying to use the Data Reader source with an ODBC connection manager.

To extract data from an ODBC source, try the following:

Add an ADO.Net Connection Manager.|||

Thank you so much - that was the problem. I have another problem, but it may be the ODBC driver itself - for some reason, it is showing all the string fields as nvarchar, and the destination fields are varchar. Is there a way of globally converting Unicode to non-Unicode?

|||

Your suggestion works for establishing the connection in the dataflow, but the data transfer rate is extremely slow compared to SQL 2000 DTS. In SQL 2000 DTS, we can retrieve just under half a million records from Lotus Notes in about 13 minutes using the NotesSQL ODBC driver 3.02g in a System DSN. Utilizing the technique you describe above with the same DSN on the same machine as SQL 2000 DTS, the same transfer takes about 57 minutes in SQL 2005 SSIS.

Is there anything that can be done to improve the performance in SSIS to retrieve data from NotesSQL via ODBC? Thanks!

sql

ODBC Data Source error

As other contributors, all I am trying to do is import data from an ODBC source (spelled 'non-Microsoft data source') into a SQL 2005 table. I can easily do this in SQL 2000 with DTS, but when I use the same DSN in VS 2005 it doesn't work.

I created an integration project, and made a connection in Connection Manager to the DSN and clicked Test Connection. It succeeded, or so it claimed.

Click OK and drag a DataReader Source onto the Data Flow surface Doubleclick it and select the connection manager per above. Note the error: Error at Data Flow Task [DataReader Source[50]]: Cannot acquire a managed connection from the run-time connection manager.

What does that mean? More to the point, how to fix it?

I wonder if you are using an ODBC connection manager? That will not work with the Data Reader Source.

The ODBC connection manager uses native ODBC and can be used with the ExecuteSQL Task.

The DataReader source needs an ADO.Net Connection Manager which can in turn reference a DSN through the ODBC Data Provider for .Net.

Donald Farmer

|||

Donald, thanks for your reply. Clearly I am missing something, though. In the designer, the Execute SQL task is in the toolbox for Control Flow, and the Ole Db Destination task is in the toolbox for Data Flow. There is no task in Data flow that I can find that will map columns from the ODBC source to the OLE DB destination, and there doesn't appear to be a task in Control Flow to do this either.

Again, I am trying to append records from an ODBC table to a SQL 2005 table. The tables have identical column names and equivalent data types. What do I need to do?

Thanks,

Steve

|||

ODBC is supported in the data flow by the Data Reader source adapter. I think the original problem may have been that you were trying to use the Data Reader source with an ODBC connection manager.

To extract data from an ODBC source, try the following:

Add an ADO.Net Connection Manager.|||

Thank you so much - that was the problem. I have another problem, but it may be the ODBC driver itself - for some reason, it is showing all the string fields as nvarchar, and the destination fields are varchar. Is there a way of globally converting Unicode to non-Unicode?

|||

Your suggestion works for establishing the connection in the dataflow, but the data transfer rate is extremely slow compared to SQL 2000 DTS. In SQL 2000 DTS, we can retrieve just under half a million records from Lotus Notes in about 13 minutes using the NotesSQL ODBC driver 3.02g in a System DSN. Utilizing the technique you describe above with the same DSN on the same machine as SQL 2000 DTS, the same transfer takes about 57 minutes in SQL 2005 SSIS.

Is there anything that can be done to improve the performance in SSIS to retrieve data from NotesSQL via ODBC? Thanks!

ODBC Connects

Hi there!

Apologies to you Whiz kids for my ignorance herewith but I am trying to link an SQL database table to another database table from which I want to import data.

I'm an "Access" database girl who has had to face the fact that my database must now become an adult and join the 'big league' and so I am currently "playing" in SQL as I try to come to grips with this new programme. In Access, ODBC links were so easy! I used to go to TABLES, select LINK TABLES, select my ODBC link, log into the other database and, viola!, the tables would be there. I'd select the one/s I wanted and could even limit the fields that came though.

How does one do this in SQL? I do have an SQL manual here but have no idea where to even start reading in that (and it's a BIG MANUAL!)

If anyone can give me some direction on how to do this, I would be most appreciative. Remember, I'm a baby in SQL so please keep it simple!

Thanks everyone!!

MariaI'm not much ahead of you and perhaps there's a better way but...

SELECT * FROM OPENROWSET( parameters )

-- OR --

SELECT * FROM table_name1 JOIN OPENROWSET( parameters)

would appear to fit the bill.

Trouble is I can't get the 'parameters' bits figured out! (see my earlier post 'openrowset parameters").

Also DTS (Data Transformatin Services) makes it a snap to import via ODBC etc but is tedious to maintain for anything more than quick fixes.|||Do you want to use SQL Server databsese tables in Access? If you do than you have two choices:

1) Use the "old fashion" ODBC Databases tehnique: first create an ODBC chanel to your SQLServer database (From ODBC Manager in Control panel, or in Administrative Tools if you are using Windows 2000. You can create either a file datasource or a machine datasource). Then you can use this chanel in you link table wizard.

2) Starting with Access 2000, you can have a different type of database: .adp - Microsoft Access Project. This type of "database" allows you to use Access as a front-end to your SQLServer database. This means that you have tables, queries, storeproc in SQL Server and Forms and Reports in Access (all in one single project - .adp) For these kind of project native driversfor SQLServer are used. With Access 2000 you can use SQLServer 7 database, and with Access 2002 (XP) you can use SQLServer 2000 databases.

.Adp are version dependent as you can see from above paragraph. With "link method" you can use any type of SQLServer database you want. The only thing you have to have is the correct version of ODBC drivers for SQLServer. You can download ODBC drivers from microsoft. They are found in a package called "mdac" (Microsoft data access components)

IONUT

PS
As an own opinion it's a very good ideea to migrate your databases to SqlServer, but you should also stop using Access even for a front end. It's very slow with large amounts of data, it has runtime libraries anly from XP version (as much as I know) and therefore is very expensive (you have to have a MS Office licence for each seat). It's true that it is easy to code and it has one of the best report designer Microsoft has ever build, but... that's all

Good luck!|||How would one link the tables of one (production DB) to another SQL DB?

Thanks!!|||Hi there!

Thanks for that. I am actually, trying to leave out Access altogether and link the SQL database (which will be my data warehouse) to the source database where staff completed their service statistics. To date, I am using Access to link to the souce database but this is becoming too large and, as you will appreciate, is slow.

The ODBC connnection, that I am already using for the Access link/import is the same for SQL (according to the software house who produce the source database) so I just need now to tell SQL to go and get the specified fields/tables from the source database and dump them into new tables in this new SQL database. That's the bit I'm having the problems with.

Cheers!

Maria

Originally posted by ionut calin
Do you want to use SQL Server databsese tables in Access? If you do than you have two choices:

1) Use the "old fashion" ODBC Databases tehnique: first create an ODBC chanel to your SQLServer database (From ODBC Manager in Control panel, or in Administrative Tools if you are using Windows 2000. You can create either a file datasource or a machine datasource). Then you can use this chanel in you link table wizard.

2) Starting with Access 2000, you can have a different type of database: .adp - Microsoft Access Project. This type of "database" allows you to use Access as a front-end to your SQLServer database. This means that you have tables, queries, storeproc in SQL Server and Forms and Reports in Access (all in one single project - .adp) For these kind of project native driversfor SQLServer are used. With Access 2000 you can use SQLServer 7 database, and with Access 2002 (XP) you can use SQLServer 2000 databases.

.Adp are version dependent as you can see from above paragraph. With "link method" you can use any type of SQLServer database you want. The only thing you have to have is the correct version of ODBC drivers for SQLServer. You can download ODBC drivers from microsoft. They are found in a package called "mdac" (Microsoft data access components)

IONUT

PS
As an own opinion it's a very good ideea to migrate your databases to SqlServer, but you should also stop using Access even for a front end. It's very slow with large amounts of data, it has runtime libraries anly from XP version (as much as I know) and therefore is very expensive (you have to have a MS Office licence for each seat). It's true that it is easy to code and it has one of the best report designer Microsoft has ever build, but... that's all

Good luck!|||LOL!! Glad to know there are others in the same situation as me!! I'll check out your posting re the parameters. The replies there may be exactly what I am after.

I've tried the DTS and it works, albiet slowly from Access but getting it to talk to the source software (Jade) is proving the problem. According to the software suppliers, it is the exact same ODBC link as used when importing in to Access but I can't get it work to date. I generally get an MMC.exe error and it 'packs a sad'.

I'll keep you posted on what I learn from here!

Cheers!

Maria

Originally posted by berniev
I'm not much ahead of you and perhaps there's a better way but...

SELECT * FROM OPENROWSET( parameters )

-- OR --

SELECT * FROM table_name1 JOIN OPENROWSET( parameters)

would appear to fit the bill.

Trouble is I can't get the 'parameters' bits figured out! (see my earlier post 'openrowset parameters").

Also DTS (Data Transformatin Services) makes it a snap to import via ODBC etc but is tedious to maintain for anything more than quick fixes.|||Also, have a look at "linked servers" under SQL Sercurity tab.

You still have to either input various parameters, but in my case this worked immediately USING A DSN.

And then
SELECT *
FROM OPENQUERY(linked_server_name, 'SELECT * FROM table_name')
-- works

To run DSN-less is still eluding me, but a reply to my post did lead me to save the DTS as VBscript which gave a heap of info. Problem is that the DTS seem to have its own way of doing things that is different to TSQL. Worse, it uses Microsoft Jet OLEDB 4.0, which SQLServer2000 Books on line says is for Access only! (I thought of you) I am using SQLServer7. Perhaps there's a difference. And all references to connectionproperties seem to refer to DTS programming only.

Friday, March 23, 2012

ODBC Connection to a linked database

I'd like to set up an ODBC DSN to a table in a linked SQL Server, via
my local SQL Server.

I'm having a few problems:
1. When I use Enterprise Manager to link the remote SQL Server, it
doesn't allow me to select the database in the remote server. It only
shows one database.

2. When I use the Data Sources program to set up the ODBC DSN, it only
shows databases in the local SQL Server, not in the linked one. If I
try typing it in: [NAMEOFLINKEDSERVER].databasename - it tells me that
it is an invalid table.Thats quite normal, but you are able to use the four part notation,
which will switch to another database if specified.

E.g. ODBC Connection points automatically to Northwind ( as the default
database of the user) you can use

SELECT <columnlist> FROM Linkdservername.Databasename.Objectname

which switches to the other database to select.

HTH, Jens Suessmeyer.|||Jens,

Thank you.

I'd rather not need to change the table names in the MDB. They just
use the default database of the ODBC Data Source. How can I set the
ODBC default database to be a database in a linked server?|||if you are using a DSN, just go in the ODBC Administrator (of Windows)
and change the database to the ones needed.

HTH, jens Suessmeyer.|||Jens,

Thanks - but the ODBC Adminsitrator only shows *local* databases, not
databases on the linked server. If I try to just type it in, it tells
me that it's not a valid db, and refuses to let me do so!!!|||How did you register the linked server ? Is it a DSN bind linked server
or was it specified within a conneciton string ? ODBC Administrator
doesnt show only the local databases, it shows the servers/databases
that were specified within the DSN. Look at the server ODBC Admin to
see if connection to your linked server is specified (some people look
on their local DSN rather than looking on the remote DSNs onthe SQL
Server which uses the linked server)

HTH, Jens Suessmeyer.

Monday, March 19, 2012

ODBC command

hi,

I have a search function.

I was able to display attributes of a record in one table, but

I also need to get one attribute from another table.

My question is how can I implement inner join in this kind of query in odbc command?

this is a part of my code:

1'||||| Create Command Object2Dim odbcCommand_searchAs OdbcCommand =New OdbcCommand("Select TM0001.syain_id, TM0001.syain_name, TM0001.syain_pass, TM0001.empl_date, TM0001.birth_date, TM0011.office_name from TM0001,TM0011 where TM0001.syain_id = ? or TM0001.syain_name = ? and TM0011.office_id = TM0001.office_id ", MyConn)34'||||| Parameters and set values.5 odbcCommand_search.Parameters.Add("@.P1", OdbcType.Char).Value = TextBox_id_name.Text'emp_id.ToString6 odbcCommand_search.Parameters.Add("@.P1", OdbcType.Char).Value = TextBox_id_name.Text'emp_name.ToString789Dim objReaderAs Odbc.OdbcDataReader10 objReader = odbcCommand_search.ExecuteReader()11While objReader.Read()1213 TextBox_id.Text = objReader("syain_id")14 TextBox_name.Text = objReader("syain_name")15 TextBox_pswd.Text = objReader("syain_pass")16 DropDownList_office.Text = objReader("office_name")17 hire_date = objReader("empl_date")181920End While2122 objReader.Close()2324


All values can be displayed except for the "office_name" which is from another Table "TM0011".

hope you can help me with this.

thanks

sheila

You want something like

...from TM0001INNER JOIN TM0011ON TM0011.office_id = TM0001.office_id where TM0001.syain_id = ? or TM0001.syain_name = ?

That is the gist. Just make sure you are joining the matching fields that you are looking for.

|||

You can also try this:

Select TM0001.syain_id, TM0001.syain_name, TM0001.syain_pass, TM0001.empl_date, TM0001.birth_date, (SELECT TM0011.office_name FROM TM0011 WHERE TM0011.office_id = TM0001.office_id) FROM TM0001 WHERE TM0001.syain_id = ? OR TM0001.syain_name = ?

Monday, March 12, 2012

ODBC and DB-Lib bcp

Question - I have a little app that uses the ODBC Bulk Operations and DB-Lib
bcp functions to load data into a table from variables (bcp_sendrow). It
works great on SQL 2000, but I'm encountering some problems on SQL 6.5.
Basically on the SQL 6.5 box the bcp_init function is returning FAIL instead
of SUCCEED. It works on SQL 2000, so it doesn't appear to be my code, but
I'm not 100% on that either. Anyone know why this might be happening and
what could be done to fix it?
ThanksFigured out the problem. MDAC versioning.
"Mike C#" <xyz@.xyz.com> wrote in message
news:e7s8QiKvGHA.3552@.TK2MSFTNGP03.phx.gbl...
> Question - I have a little app that uses the ODBC Bulk Operations and
> DB-Lib bcp functions to load data into a table from variables
> (bcp_sendrow). It works great on SQL 2000, but I'm encountering some
> problems on SQL 6.5. Basically on the SQL 6.5 box the bcp_init function is
> returning FAIL instead of SUCCEED. It works on SQL 2000, so it doesn't
> appear to be my code, but I'm not 100% on that either. Anyone know why
> this might be happening and what could be done to fix it?
> Thanks
>

ODBC Access to SQL Table

I need your help. I have a MS SQL Server in our DMZ that I need to setup an
MS Access ODBC connection to the SQL Server. I am using port 1433 opened on
the firewall but I can't bring up the SQL Server. Is there as way to
trouble shoot these issues or maybe a document on setting up ODBC
connections? I have no trouble within the LAN in our Active Directory.
Please help! Thanks
NC Beach BumDoes your SQL Server allow incoming connections for TCP/IP on port 1433.
Perhaps check your client configuration and make sure that it allows
incoming connections. If this is SQL 2005 you can use your surface area
configuration tool to make sure the protocol is allowed.
--
/*
Warren Brunk - MCITP,MCTS,MCDBA
www.techintsolutions.com
*/
"NC Beach Bum" <NCBeachBum@.discussions.microsoft.com> wrote in message
news:EBE2C819-A798-48BD-A179-B511C9D79B31@.microsoft.com...
>I need your help. I have a MS SQL Server in our DMZ that I need to setup
>an
> MS Access ODBC connection to the SQL Server. I am using port 1433 opened
> on
> the firewall but I can't bring up the SQL Server. Is there as way to
> trouble shoot these issues or maybe a document on setting up ODBC
> connections? I have no trouble within the LAN in our Active Directory.
> Please help! Thanks
> --
> NC Beach Bum

ODBC Access to SQL Table

I need your help. I have a MS SQL Server in our DMZ that I need to setup an
MS Access ODBC connection to the SQL Server. I am using port 1433 opened on
the firewall but I can't bring up the SQL Server. Is there as way to
trouble shoot these issues or maybe a document on setting up ODBC
connections? I have no trouble within the LAN in our Active Directory.
Please help! Thanks
NC Beach Bum
Does your SQL Server allow incoming connections for TCP/IP on port 1433.
Perhaps check your client configuration and make sure that it allows
incoming connections. If this is SQL 2005 you can use your surface area
configuration tool to make sure the protocol is allowed.
/*
Warren Brunk - MCITP,MCTS,MCDBA
www.techintsolutions.com
*/
"NC Beach Bum" <NCBeachBum@.discussions.microsoft.com> wrote in message
news:EBE2C819-A798-48BD-A179-B511C9D79B31@.microsoft.com...
>I need your help. I have a MS SQL Server in our DMZ that I need to setup
>an
> MS Access ODBC connection to the SQL Server. I am using port 1433 opened
> on
> the firewall but I can't bring up the SQL Server. Is there as way to
> trouble shoot these issues or maybe a document on setting up ODBC
> connections? I have no trouble within the LAN in our Active Directory.
> Please help! Thanks
> --
> NC Beach Bum

Odbc access

I have a DB and some tables that I'm moving to Sql2005 machine that just get
query access. People use ACCESS with ODBC link table.
What permissions other than datareader would allow them to only see USER
tables?
Thanks.
db_datareader is enough.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"AHartman" wrote:

> I have a DB and some tables that I'm moving to Sql2005 machine that just get
> query access. People use ACCESS with ODBC link table.
> What permissions other than datareader would allow them to only see USER
> tables?
>
> Thanks.
>
>
|||That's what I gave but when linking the tables the user saw lot of sys
tables also.
"Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
news:9602F1EB-8E2D-4B02-85FE-25FC2689E670@.microsoft.com...[vbcol=seagreen]
> db_datareader is enough.
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
> "AHartman" wrote:
|||Do not worry about those tables, they are SQL Server catalog views.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"AHartman" wrote:

> That's what I gave but when linking the tables the user saw lot of sys
> tables also.
>
> "Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
> news:9602F1EB-8E2D-4B02-85FE-25FC2689E670@.microsoft.com...
>
|||Thanks..
Just didn't want to clutter there view of valid tables...
"Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
news:410C1840-0476-4606-8BC9-70D2345EC6E2@.microsoft.com...[vbcol=seagreen]
> Do not worry about those tables, they are SQL Server catalog views.
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
> "AHartman" wrote:

Odbc access

I have a DB and some tables that I'm moving to Sql2005 machine that just get
query access. People use ACCESS with ODBC link table.
What permissions other than datareader would allow them to only see USER
tables?
Thanks.db_datareader is enough.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"AHartman" wrote:
> I have a DB and some tables that I'm moving to Sql2005 machine that just get
> query access. People use ACCESS with ODBC link table.
> What permissions other than datareader would allow them to only see USER
> tables?
>
> Thanks.
>
>|||That's what I gave but when linking the tables the user saw lot of sys
tables also.
"Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
news:9602F1EB-8E2D-4B02-85FE-25FC2689E670@.microsoft.com...
> db_datareader is enough.
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
> "AHartman" wrote:
>> I have a DB and some tables that I'm moving to Sql2005 machine that just
>> get
>> query access. People use ACCESS with ODBC link table.
>> What permissions other than datareader would allow them to only see USER
>> tables?
>>
>> Thanks.
>>|||Do not worry about those tables, they are SQL Server catalog views.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"AHartman" wrote:
> That's what I gave but when linking the tables the user saw lot of sys
> tables also.
>
> "Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
> news:9602F1EB-8E2D-4B02-85FE-25FC2689E670@.microsoft.com...
> >
> > db_datareader is enough.
> >
> > Hope this helps,
> >
> > Ben Nevarez
> > Senior Database Administrator
> > AIG SunAmerica
> >
> >
> >
> > "AHartman" wrote:
> >
> >> I have a DB and some tables that I'm moving to Sql2005 machine that just
> >> get
> >> query access. People use ACCESS with ODBC link table.
> >> What permissions other than datareader would allow them to only see USER
> >> tables?
> >>
> >>
> >> Thanks.
> >>
> >>
> >>
>|||Thanks..
Just didn't want to clutter there view of valid tables...
"Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
news:410C1840-0476-4606-8BC9-70D2345EC6E2@.microsoft.com...
> Do not worry about those tables, they are SQL Server catalog views.
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
> "AHartman" wrote:
>> That's what I gave but when linking the tables the user saw lot of sys
>> tables also.
>>
>> "Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
>> news:9602F1EB-8E2D-4B02-85FE-25FC2689E670@.microsoft.com...
>> >
>> > db_datareader is enough.
>> >
>> > Hope this helps,
>> >
>> > Ben Nevarez
>> > Senior Database Administrator
>> > AIG SunAmerica
>> >
>> >
>> >
>> > "AHartman" wrote:
>> >
>> >> I have a DB and some tables that I'm moving to Sql2005 machine that
>> >> just
>> >> get
>> >> query access. People use ACCESS with ODBC link table.
>> >> What permissions other than datareader would allow them to only see
>> >> USER
>> >> tables?
>> >>
>> >>
>> >> Thanks.
>> >>
>> >>
>> >>
>>

Odbc access

I have a DB and some tables that I'm moving to Sql2005 machine that just get
query access. People use ACCESS with ODBC link table.
What permissions other than datareader would allow them to only see USER
tables?
Thanks.db_datareader is enough.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"AHartman" wrote:

> I have a DB and some tables that I'm moving to Sql2005 machine that just g
et
> query access. People use ACCESS with ODBC link table.
> What permissions other than datareader would allow them to only see USER
> tables?
>
> Thanks.
>
>|||That's what I gave but when linking the tables the user saw lot of sys
tables also.
"Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
news:9602F1EB-8E2D-4B02-85FE-25FC2689E670@.microsoft.com...[vbcol=seagreen]
> db_datareader is enough.
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
> "AHartman" wrote:
>|||Do not worry about those tables, they are SQL Server catalog views.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"AHartman" wrote:

> That's what I gave but when linking the tables the user saw lot of sys
> tables also.
>
> "Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
> news:9602F1EB-8E2D-4B02-85FE-25FC2689E670@.microsoft.com...
>|||Thanks..
Just didn't want to clutter there view of valid tables...
"Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
news:410C1840-0476-4606-8BC9-70D2345EC6E2@.microsoft.com...[vbcol=seagreen]
> Do not worry about those tables, they are SQL Server catalog views.
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
> AIG SunAmerica
>
> "AHartman" wrote:
>

ODBC - SQL Server 200 - MFC - Visual C++.NET (2003)

Hello!
My problem is:
In Sql Server I made a table "Nir" with 3 columns:
Nr_crt - numeric
Val_TVA - numeric
Val_Tot - numeric
In SQL Server the command:
SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir - returned
me a result with 2 sums... OK!
My question is:
In Visual C++ - MFC I don't know how can to execute this command and to get
the result return by this comand (may be with a VARIANT - pvRecord I don't
know)
How to access the result return by this command''
I use CDatabase and CRecordset.
Thank You very much!Create a CRecordset, then execute the SQL statement on it. Then you have
can use GetFieldValue on the recordset grab the results in CDBVariants.
"Florin" <Florin@.discussions.microsoft.com> wrote in message
news:382C3711-E222-4173-BF8A-81EBD7E3508A@.microsoft.com...
> Hello!
> My problem is:
> In Sql Server I made a table "Nir" with 3 columns:
> Nr_crt - numeric
> Val_TVA - numeric
> Val_Tot - numeric
>
> In SQL Server the command:
> SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir -
> returned
> me a result with 2 sums... OK!
>
> My question is:
> In Visual C++ - MFC I don't know how can to execute this command and to
> get
> the result return by this comand (may be with a VARIANT - pvRecord I don't
> know)
> How to access the result return by this command''
> I use CDatabase and CRecordset.
>
> Thank You very much!
>
>

ODBC - SQL Server 200 - MFC - Visual C++.NET (2003)

Hello!
My problem is:
In Sql Server I made a table "Nir" with 3 columns:
Nr_crt - numeric
Val_TVA - numeric
Val_Tot - numeric
In SQL Server the command:
SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir - returned
me a result with 2 sums... OK!
My question is:
In Visual C++ - MFC I don't know how can to execute this command and to get
the result return by this comand (may be with a VARIANT - pvRecord I don't
know)
How to access the result return by this command??
I use CDatabase and CRecordset.
Thank You very much!
Create a CRecordset, then execute the SQL statement on it. Then you have
can use GetFieldValue on the recordset grab the results in CDBVariants.
"Florin" <Florin@.discussions.microsoft.com> wrote in message
news:382C3711-E222-4173-BF8A-81EBD7E3508A@.microsoft.com...
> Hello!
> My problem is:
> In Sql Server I made a table "Nir" with 3 columns:
> Nr_crt - numeric
> Val_TVA - numeric
> Val_Tot - numeric
>
> In SQL Server the command:
> SELECT SUM(Val_TVA) AS Val_TVA, SUM(Val_Tot) AS Val_Tot FROM Nir -
> returned
> me a result with 2 sums... OK!
>
> My question is:
> In Visual C++ - MFC I don't know how can to execute this command and to
> get
> the result return by this comand (may be with a VARIANT - pvRecord I don't
> know)
> How to access the result return by this command??
> I use CDatabase and CRecordset.
>
> Thank You very much!
>
>