|
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.
|
|
|
|
|
There are differences in syntax, but in this case it may be that your connection is trying to use the Access (Jet) provider instead of the MSSQL provider.
"Welcome to Arizona! Drive Nice - We're Armed..." - Proposed Sign at CA/AZ Border
|
|
|
|
|
try to use fully qualified names :
databasename.dbowner.tablename
|
|
|
|
|
Maybe you should use "DELETE FROM table1" for MSSQL. Just have a try.;)
Kyle Chen
|
|
|
|