|
Hello all.
With ASP/ADO I tried query the Indexing Server of WIndows 2000 server and extract with success many usefull information about files, like Author,Company,Comments,Version ecc. ecc.
Now, how can do this with ADO.NET/ASP.NET.
I have to use a OleDb Provider?
Thanks in advance.
Sergio Bertini
|
|
|
|
|
|
Hi!
I can't build with VC++ 7.0 the project that use DAO. The VC++ 6.0 build correctly the same project. I receive the following error message:
fatal error LNK1120: 1 unresolved externals
"public: class ATL::CStringT > > __thiscall CdbLastOLEError::GetDescription(void)"
Do you now somebody the resolution?
Thanks
Feri
|
|
|
|
|
I have a consumer template like:
[
db_command(L"{ ? = CALL dbo.MyProcedure(?) }")
]
class MyProcedure
{
...
[ db_param(1, DBPARAMIO_OUTPUT) ] LONG m_RETURN_VALUE;
[ db_param(2, DBPARAMIO_INPUT) ] LONG m_id;
void GetRowsetProperties(CDBPropSet* pPropSet)
{
pPropSet->AddProperty(DBPROP_CANFETCHBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
pPropSet->AddProperty(DBPROP_CANSCROLLBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
}
};
And when I use it I do:
storedproc.m_id = someValue;
HRESULT hr = storedproc.Open(session);
hr = storedproc.MoveFirst();
if(hr == S_OK && storedproc.m_RETURN_VALUE == 0)
doSomething();
else
reportBloodyFailure();
It does not work! MoveFirst returns S_OK, the data from the rowset is in the accessor, but the darn return value is not valid! it's 0xcccccccc which looks an awful lot like uninitialized stack memory... The only two valid return values from this function is 0 or 2 (where 2 is an error code).
Is there anything special I have to do to actually get the return code?
Sonorked as well: 100.13197 jorgen
FreeBSD is sexy.
|
|
|
|
|
hey, I have a ms access file that stores when an entry was made. if that date field is today, i want to store it in a recordset object. how do i query that?
"SELECT CheckDate WHERE Checkdate = ???? TO ???? "
how would that work??? Please help! Thanks a bunch!
~Timothy T. Rymer
http://tim.xpertz.com
http://www.digipen.edu
http://www.ttrx.com
|
|
|
|
|
SELECT CheckDate WHERE CheckDate BETWEEN #??/??/??# AND #??/??/??# should do it.
|
|
|
|
|
Ed Gadziemski wrote:
SELECT CheckDate WHERE CheckDate BETWEEN #??/??/??# AND #??/??/??# should do it.
Thanks! I live and learn. Being doing it the hard way all this time
FEI: for SQL users replace the hash/pound, #, with a single quote, '. e.g. SELECT CheckDate WHERE CheckDate BETWEEN '??/??/??' AND '??/??/??'
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
Tim Smith wrote:
Over here in the third world of humor (a.k.a. BBC America),
peterchen wrote:
We should petition microsoft to a "target=_Paul" attribute.
|
|
|
|
|
Greetings,
Is there a way to get the names of the keys that each table has in ADO? I just want to display a each table's keys so that the user can see what keys are available.
Thanks in advance!
|
|
|
|
|
Greetings,
I figured it out, all you have to do is the following:
_variant_t p(long(0));
FieldPtr pItem = pRecordset->Fields->GetItem((p)/*_variant_t(&index)*/);
CString szName = (LPCSTR)_bstr_t(pItem->Name);
and this gives you the key name (column heading) for an access database.
|
|
|
|
|
Greetings,
How do I get a list of available tables using ADO? I am not sure how to do this? I am a newbie to ADO.
Thanks in advance!
|
|
|
|
|
I think this article will help you:
Interactive SQL Tool (using ADO)
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Thanks, that is exactly what I needed!
|
|
|
|
|
Heya
Make a "SELECT * FROM sysobjects WHERE xtype = 'U'", this will list all user tables from the database you make this query on.
If you want to list all databases the "SELECT * FROM master.dbo.sysdatabases"
/WW
|
|
|
|
|
Can someone give me a working example of one of these two OleDb interfaces? I
need to do a query to the DBMS (SQL Server 2000) and then every X seconds
(where X is customizable) I want to ask to the DBMS if there are
new/modified rows...
Bye
Max
|
|
|
|
|
I'm trying to implement simple OLEDB consumer classes for some stored procedures. It turned out that SPs must be attributed in VS.NET.
If I have understood attributes correctly, they are static properties right? So if I have an OLEDB SP like this:
<br />
[<br />
db_source(L"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=xxxdb;Data Source=SOMEHOST;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=SOMEWORKSTATION;Use Encryption for Data=False;Tag with column collation when possible=False"),<br />
db_command(L"{ ? = CALL dbo.SomeProcedure(?,?,?) }")<br />
]<br />
class CLoadSheetItem<br />
{<br />
public:<br />
};<br />
How can I change the Data Source property during runtime? I want this software to be flexible enough so that I can install it and do a simple setup during installation. Is it even possible to change the data source attribute at runtime?
Sonorked as well: 100.13197 jorgen
FreeBSD is sexy.
|
|
|
|
|
Nevermind that question..
Sonorked as well: 100.13197 jorgen
FreeBSD is sexy.
|
|
|
|
|
All right CPians.
This is not a programming question and I'm sure it is very basic, so I
thought I'll ask it in here.
My friend has database that he is working on. At the moment he has machine that runs MySQL server (running on Windows) and he connects from his workstation.
Now I need to have the same database running on Linux.
So my question is where the data is stored. Is it stroed on the server or in his workstation. As you can see I have no experience in MySQL so any help would be appreciated.
Venet.
Aquila non captat muscas.
|
|
|
|
|
When i use GetCollect on WindowsXP machine, it's OK, but on Windows2000 it isn't. I have tryed with: Fields->GetItem(&varIndex)->GetValue(), but the result was the same. Have anybody some idea?
|
|
|
|
|
How can i return a recorset from a Stored procedure ?
rs = Cmd1->Execute(NULL, NULL,adCmdStoredProc);
why is this allways returning a closed recorset?
Casa.Sapo.pt
|
|
|
|
|
I don't know the answer but there are some articles in CP about stored procedure.Have you looked at them?
http://www.codeproject.com/database
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
That third parameter on your Execute call looks dodgy, I think it should be something like adNoOptionSpecified (it might be slightly spelt incorrectly, check MSDN)
|
|
|
|
|
I'm running SQL Server 2000. I have Transaction Logs configured to "Automatically Grow File" with "Unrestricted File Growth"... and I've noticed that some are starting to get quite huge.
My questions are this:
- Is there an easy way to keep the transaction log no larger than a certain size, without human intervention?
- If I tell SQL Server 2000 to limit the transaction log growth to X MB, will it stop when it hits X MB (and SQL server stop working?) or will it simply keep the last X MB of transaction log information?
- I don't think I actually ever use transactions. I mostly just use the basic SQL commands (Insert, Delete, etc.). What is the purpose of "transaction logs" if I'm not using "transactions" when I'm modifying data? Are they needed? Can they be turned off?
Thanks for any insight into these questions. It is greatly appreciated.
Regards, Larry Antram
Stardust Software
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones."
-- Albert Einstein
|
|
|
|
|
I'm going from memory here, so hope this is right:
I think it will crash if you limit the log to X MB and fill it up. Instead, do a "dump trans" (something like that, you'll need to look up the exact syntax) regularly, perhaps as part of a nightly script. That will stop the logs from growing so big.
Transactions are automatically generated for some operations such as insert and delete. You can also explicitly bound a transaction with begin trans....end trans.
|
|
|
|
|
Hi Larry,
you can't stop growing this file. You have to backup the log-file using the option "Remove inactive entries from transaction log". Use "Database Maintenance Plans" to do it without human intervention. If your file is too large you can shrink it after your log-backup.
Regards,
Sebastian
|
|
|
|
|
Do complete DB backups or Tran Log backups are regular intervals. My general rule is to run a complete backup on Sunday at 3a and then run differential backups at 3a daily after that... each week overwriting the previous week (history is maintained through tapes).
-AC MCDBA
Andrew Connell
IM on MSN
andrew@aconnell.com
|
|
|
|