|
are you processing the results on the server before display? if so you could do the previous suggestion and simply run a flip algorithm on the results set in memory
reasons like this stop me using recordset objects
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hello,
Maybe this will help you.
SELECT a.member_no
FROM adult AS a
WHERE a.member_no IN
(SELECT TOP 10 b.member_no
FROM adult AS b
ORDER BY b.member_no desc)
ORDER BY a.member_no
It's not elegant.
It works!!
Edwin.
|
|
|
|
|
Hi there,
I was wondering if there is anyway to set the size of SQL Server log files that you can see under the "Management" folder.
thanks
|
|
|
|
|
I've created an MFC application using DAO to access a DBASE database. It works great on my system, but when trying to run the MFC application on a clean win98 system, i get a
"Unable to initialize DAO/Jet db engine." error. Does anyone know how i can fix this?!?! I've tried installing the newest version of MDAC...but this did'nt help.
|
|
|
|
|
I have installed MDAC 2.5 on a development machine and am trying to use the OLE DB consumer templates to access an Oracle database. Oddly it seems that I also have to have installed the Oracle client in order to get this to work. Does anyone have an example of how open a datasource using the microsoft OLE DB provider. I'm using the following, but it will only work if the Oracle client is installed also
HRESULT hr;
CDataSource db;
CDBPropSet dbinit(DBPROPSET_DBINIT);
// dbinit.AddProperty(DBPROP_AUTH_PASSWORD, OLESTR("PASSWORD"));
// dbinit.AddProperty(DBPROP_AUTH_USERID, OLESTR("USERID"));
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, OLESTR("DB_NAME"));
// dbinit.AddProperty(DBPROP_INIT_LCID, (long)1033);
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)DBPROMPT_COMPLETE);
// dbinit.AddProperty(DBPROP_INIT_PROVIDERSTRING, OLESTR(""));
// hr = db.Open(_T("OraOLEDB.Oracle.1"), &dbinit);
hr = db.Open(_T("MSDAORA.1"), &dbinit);
Any comments are welcome. Thanks.
Chris
|
|
|
|
|
Sorry - MS OLEDB provider for Oracle requires Oracle client. From MDAC 2.5 documentation:
"The Microsoft OLE DB Provider for Oracle requires a system running: Oracle client software (appropriately installed and configured) version 7.3.3.4.0 or later, or for Oracle8, version 8.0.4.1.1c"
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks, Tomasz. I happened to miss that little gem. And it certainly helps answer a lot of questions.
Chris
|
|
|
|
|
Help me please!!!
I want convert data from access table to Excel file in code.
How can I do this?
Thank's to everybody!!!
|
|
|
|
|
I get the error "Connection is busy with results for another hstmt" when I call the CRecordset::Open on an SQLServer database. The code has been working for several years on WATSQL (now Sybase SQLAnywhere) until I switched the database recently to run on SQLServer. Does anyone have an idea what is going on, or what options I may need to set to get rid of this. For instance, in the code below, line (1.) works without problem, while line (2.) fails giving the error above. Both statements were failing on ::SQLExecute(m_hstmt) inside MFC;
1. if (!m_pAssetSet->Open(CRecordset::snapshot))
DisplayError();
2. if (!m_pAssetypeSet->Open(CRecordset::snapshot))
DisplayError();
Also, when I switch the code to call Open with default arguments, both Open statements work, but then my Add/Edit/Update on m_pAssetSet fails right in the bowels of MFC with SQLSetPos on line (1.) as follows:
::SQLSetPos(m_hstmt, 1, wPosOption, SQL_LOCK_NO_CHANGE);
The second error message is something to the effect that an option is invalid. Does anyone have any idea what is causing this? Why should I be getting this even when I call CRecordset::Open with default arguments.
Any suggestions?
|
|
|
|
|
Hi,
I execute the following querry in querry analyser and it takes more than 2 minutes to complete the execution. this is the querry
select * from tablename
table has 155000 records and it is indexed.
is it a common one or does the sql server requires any tuning adjustments.
pls help
srinivasan
|
|
|
|
|
create an index on the table.
Visual Basic programmer.
--------------------------------------------------
Share your thoughts..
|
|
|
|
|
Depending on your settings in the analyzer, queries can tak a lot longer than when running from a normal client...
Maybe the server needs more memory/cpu
maybe the disks are too slow
maybe the server have way too much other work to do
It's a hard question to answar without knowing a lot about the system...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Could somebody explain why the following segment of the code is throwing exception in the last line. The error is -2146825069 (0x800A0C93) Remote ADO Error: The operation requested is not allowed in this context.
//*******************************************
_ConnectionPtr pConnection = NULL ;
pConnection.CreateInstance(__uuidof(Connection));
_RecordPtr pRec = NULL ;
pRec.CreateInstance(__uuidof(Record));
_bstr_t strConn2("Provider=MSDASQL;Driver={Microsoft Text Driver (*.txt; *.csv)}; DBQ=C:\\Temp" ) ;
pConnection->Open(strConn2,"","",NULL);
pRec->Open("1.txt", pConnection.GetInterfacePtr(), adModeReadWrite, adFailIfNotExists, adOpenRecordUnspecified, "", "" ) ;
//*******************************************
What is wrong??? Why I can't open simple text file through Record object???
Bob ( Expert_30@yahoo.com)
|
|
|
|
|
Hi Bob,
i have done the following and it works:
_ConnectionPtr pConnection = NULL ;
pConnection.CreateInstance(__uuidof(Connection));
_RecordsetPtr pRec = NULL ;
pRec.CreateInstance(__uuidof(Recordset));
_bstr_t strConn2("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\Northwind.mdb") ;
pConnection->Open(strConn2,"","",NULL);
pRec->Open("SELECT * FROM [Text;Database=c:\\Temp;HDR=YES;FMT=Delimited].[1.txt]", pConnection.GetInterfacePtr(),
adOpenStatic,
adLockReadOnly,
adCmdText);
int nCount = pRec->GetRecordCount();
The data:
"Praefix";"Trennung"
"acco";5
"asso";5
"comm";5
"comp";5
"conc";5
"conf";5
|
|
|
|
|
How can i pass parameters along with SQL query( consider a buffer of binary
data also can be a parameter) in ADO's via VC++.
Please send me a sample.
My mail id is kgrajashekar@usa.net
Thanks in advance.
|
|
|
|
|
Hi there,
I have an online job that is being executed on regular schedules. On some occassions, while going through various stored procedures, a DBCC process with a spid of 6 is created. Around the same, I see a message inidicating that a deadlock has been resulted between my currently running process and this DBCC process.
This running DBCC process causes the CPU to be utilized massively and being a system process, can not be killed, unless I re-start the SQL Server.
I was wondering how one could find out the reason this DBCC process starts off to begin with? HOw do I know which DBCC command it is?
thanks
|
|
|
|
|
Hi Amigos!
Converting DB_NUMERIC to anything useful looks like a nightmare. I particularly need to convert it to a string ... can anybody help me???
Thankyou, and happy coding
NB
|
|
|
|
|
Create the client side IAccessor with a binding of DBTYPE_STR and it will do the job for you
|
|
|
|
|
Has anyone used this particular feature with Oracle databases and to success? I'm researching using this feature within an application in order to remove the redundant userid/password prompt that is presently used. The intent is to force user's to logon to the domain first before they can run the application and having done that, to *NOT* be prompted for a userid/password combination by the application. Just wondering about any tips, hints, or war stories that someone else may have.
Thanks.
Chris Meech
|
|
|
|
|
What characteristic does a program need so that a client app can interact with it through a custom made OLEDB provider?
Ernesto Moscoso Cam
|
|
|
|
|
Read the OLEDB 2.0 Reference guide. The interfaces that are mandatory should be supported by the custom OLE DB provider. A client should simply create an instance of data source object using CoCreateInstance etc, then obtaing the data source initialization interface. After that its simple COM programming to trace through various interfaces using QueryInterface etc. But you must refer to the custom provider documentation for which optional interfaces are exposed.
|
|
|
|
|
Hi,
I am trying to set up my database with the table storage and the index storage in seperate filegroups. To do this I am trying the following SQL :
CREATE TABLE ClosingArea (
ClosingArea_ID INTEGER NOT NULL,
ClosingArea_Name VARCHAR(64)
) ON MM32TABLES;
ALTER TABLE ClosingArea ADD CONSTRAINT CLOSINGAREA_PK PRIMARY KEY (ClosingArea_ID) ON MM32INDEXES;
However this initially creates the table in the MM32TABLES filegroup but the "ALTER TABLE" statement changes the table storage to MM32INDEXES when I obviously only want to store the index in that filegroup.
Any ideas why this is happening or how I can do what I want ?
thanks in advance.
|
|
|
|
|
This is because the table and primary key (or clustered index) have to be on the same filegroup. You can create a table on the MM32TABLES group and then create a non-clustered index on MM32INDEXES.
Jason Cono, MCSD
|
|
|
|
|
I am trying to write an out of process com server that is capable of passing back to the client over the network a _ConnectionPtr. It is really a simple 2-tier application. But although the pointer I am getting back looks valid I get an error when I try and open a recordset using the connection returned.
Can anybody help.
I can post some sample code if that would help.
Cheers
AndyC
|
|
|
|
|
Thank you!
I need to allow upwards of 10 District Managers remote access to an Access Database. These Managers will be spread out across Canada. Would it make sense to use an ASP or to use some software like PCAnywhere?
I am kinda stuck and would appreciate any help you can offer.
Thank you so much,
Josie Marent
|
|
|
|