|
Frank Olorin Rizzi wrote:
I mean, some of the DB-gurus I talked to didn't even know you could specify your own trace DLL
Count me in on the group. I thought I had done literally every advanced thing you can do with ODBC, but that's one thing I haven't done. When you do find out how to do this, there might be an article in there....
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
Tom Archer wrote:
When you do find out how to do this, there might be an article in there....
"If"..."If I find out"
I'll be sure to post any solution I find
F.O.R.
|
|
|
|
|
Here's the latest update I can provide:
After checking the list of routines exported by the odbctrac.dll (the one that works), and the list of routines exported by the trace.dll (the one produced by compiling the source code provided by M$ in the samples for ODBC from the MDAC SDK), I found that two routines where missing from the trace.dll:
FireVSDebugEvent
TraceVSControl
So, I added to the .def file for trace.dll.
Compiling, I got an external unreesolved error for FireVSDebugEvent
(indeed, the other one is implemented in one of the files in the project).
The signature for FireVSDebugEvent is provided, but no implementation.
So I made a dummy implementation (FireVSDebugEvent returns void, so I just
did nothing in its body), and tried again.
It *still* doesn't work.
So, my conclusion, at this time, is that there has been some change to the requirements for the ODBC trace DLL since the 2.6 version (I got the source code from MDAC SDK 2.6, but the MDAC itself is up to 2.8).
Apparently, M$ will release the ComponentChecker for MDAC 2.8 ASAP.
I am hoping that, at that time, they will release a new MDAC SDK, or provide a list of changes.
For the time being, I'll put this aside.
Hope this can provide some info to those interested,
even if it is not a solution.
F.O.R.
|
|
|
|
|
For anyone who may stumble upon this...
A colleague of mine actually fixed this to work.
Apparently, he simply added the .def file to export all of the
various TraceSQL* routines.
In addition to that, he had to include the FireVSDebugEvent
and TraceVSControl routines to the .def file.
Looking at his source, and mine,
I guess mine wasn't working because I had __declspec(_stdcall)
(or something like that...I'm not 100% sure yet).
In short:
the source code from MS seems to work once you
add the .def file.
Hope this Helps,
F.O.R.
PS: Props to my colleague, and to Brannon, who sent some helpful hints as well!
|
|
|
|
|
I have a BULK INSERT query that works fine when i call it from query analyzer, but when i call same query from VC++ application via ADO Connection Execute method, it gives me error. I tried to look at the COM error, its gives me error -2147217900
I make sure that i am using same username/password while connecting to Database either from Query Analyzer or from VC++.
Any help or tip will he highly appreciated
|
|
|
|
|
I tried to look into details of COM error, here is what i get
IDispatch error #3092
Please please help
|
|
|
|
|
The error code translates to 0x80040e14 (hex) which, looking up in oledberr.h from the Platform SDK gives DB_E_ERRORSINCOMMAND .
Did you mark your command as adCmdText when calling Execute ?
|
|
|
|
|
You can use Transaction concept in your code.When you open the connection you have to start the Transation (i.e. BeginTransaction). Once your all Bulk Insertion is finished you can either commit trasaction or rollback.
Manish Darji
|
|
|
|
|
I know that Datasets are supposed to be slower than datareaders, but exactly how slow is it? I've tried using both to compare and it would seem that the datset is about 7 times slower than the reader. Is it supposed to be this way. In one of my web application which uses dataset to populate a very large table, this seems to take forever. Is the because of the dataset or is it some Windows setting problem?
Thanks for listening.
God, I pity me! - Phoncible P. Bone
If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
|
|
|
|
|
Hi,,
it's because of the dataset..
Datasets caches data locally then you can disconnect from the datasource..This means that you'll consume alot of memory , time..
As you just populate a table..Use Datareader brcause it's made for this setuation (Fast-Forward only-Read only).
|
|
|
|
|
Thanks for answering.
I realized that, but I was wondering if is it usual to be 7 times slower?
And for my cases, I need to use the dataset because I need to manipulate the datas returned. I thought that there might be any other method/settings that I can change
God, I pity me! - Phoncible P. Bone
If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
|
|
|
|
|
Nope. The DR is a server-side cursor so only one read is actually downloaded a time. The DA/DS is downloads the entire data set when you call DA::Fill so naturally its speed will be directly tied to how large a data set you're downloading.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
Oh, OK. I thought as well. I was holding on to hope there for a while.
God, I pity me! - Phoncible P. Bone
If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
|
|
|
|
|
I want to reach to a database via DMO, but getting compile time errors. MSDN says that i should be able to get to it through item method, but compiler complaints that this is not a member of SQLDMO::Databases. Any idea what i am doing wrong?
SQLDMO::_SQLServerPtr pSQLServer;
SQLDMO::DatabasesPtr pDatabases;
SQLDMO::_DatabasePtr pDatabase;
HRESULT hr = pSQLServer.CreateInstance(__uuidof(SQLDMO::SQLServer));
pSQLServer->Connect ("MyServerName", "username", "password");
pDatabases = pSQLServer->GetDatabases();
pDatabase = pDatabases->Item("MyDatabase");
|
|
|
|
|
i use the ADO in C++ to connect to an access database file,
connecting to the database requiring registering the database first in the DSN. so, i'm asking if there anyway that let me connect to the database with only the file name or anythin. or if there anyway that can let me add the DSN from the source code ???
THanks
|
|
|
|
|
Hi,
sure you don't need to create a DSN
take this connection string as a sample:
<br />
"Provider=Microsoft.jet.oledb.4.0;Jet OLEDB:Database Password=MYPASS;Data source=C:\db1.mdb"
|
|
|
|
|
|
I've a question about VC++ and ADOCE.
From a cdb Database I will write the output in a listfield, but it doesnt go.I write the Data in the Recordset and then?
How can get the data?
Can everybody help me about this Problem?
|
|
|
|
|
Hi 2 all!
Ater I added an expression column to my DataTable (it resides within DataSet), DataAdapter.Update started to throw following exception:
---------------------------------------------------------
An unhandled exception of type 'System.Data.ReadOnlyException' occurred in system.data.dll
Additional information: Cannot change ReadOnly property for the expression column.
---------------------------------------------------------
Why such thing happens? What should I do?
|
|
|
|
|
Solution found!
You just need to correct stored procedures generated by wizars in oreder to return inserted\updated field by means output parameters.
Generated Insert\Update commands must be corrected also.
|
|
|
|
|
Hi, how can i get a list of tables with columns from a access database
by using cdatabase and crecordset? I want to use the list in
a CTreeCtrl!
|
|
|
|
|
If you'll use Access , why not to use CDaoDatabase ?
you can use methods like :GetTableDefCount , GetTableDefInfo to get CDaoTableDefInfo object.
then you can get data about each table.
|
|
|
|
|
You can use ADOX to retrieve tables/views list. If you want, I can give you some code fragment.
Kyle Chen
|
|
|
|
|
Hi all,
I have data arriving via a text file that needs to be synchronized with the data in the DBase, the problem is that the text file contains all the data that is in the DB table + changes, so i need to figure out the best way to filter only the modified data and update the table in the db.
i am currently parsing the text file into a dataset and pulling the data from the DB into a different dataset, is there a way to update the data source only with the data witch was modified ?
|
|
|
|
|
Hi,
I have two database files, an access database(jet) and a mssql database(mssqloledb).
I'm tryng to execute the query "DELETE * FROM table1", so I've created a _CommandPtr variable. When I execute the command with the access database it works fine, but when I execute the command with the mssql it throws an exception 'DB_E_ERRORSINCOMMAND'. It's a sintax error in the sql.
Is there any difference in the sintax of the sql statement between this two providers ?
ps: I can't use "SELECT * FROM table1" with the mssql provider either.
thanks.
|
|
|
|