|
how are you using the odbc stuff?
you posting doesnt give enough details to say much about what is causing the problems
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Sorry,the following is the detail!
Notice: The abc.dbf has 500 million records!!!!
The code is too long,I can only give you virtual code!(Using VC++ with ODBC API)
1.SQLDriverConnect(); //connect the database abc.dbf .
2.SQLSetStmtOption(...SQL_CURSOR_DYNAMIC);//Create a scrollable cursor.
3.SQLExecDirect(); //Execute SQL directly.(Select * from tablename)
4.SQLNumResultCols(); //Get selected column numbers.(The fields count)
5.SQLDescribeCol(); //Save column describe in an object array.
6.SQLBindCol(); //Bind every column(fields) with a variable which described in step 5.Saved in an object array.
7.SQLFetchScroll(...SQL_FETCH_LAST);//Move cursor to last record,to get selected records count!It related to step 6.
8.Use ListView show the records data which saved in an object array in setp 6.
Notice: whith the 500 million records.
Setp 1 to 6 spend a few second,but in step 7,it take much more time ,and make my
compter shutdown because there is not enough memory!
Thanks!
hi
|
|
|
|
|
Why can't you just use "select count(*) from ..." instead of traversing 500 million records?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks!
You can resolve the record numbers of the table,but how to show every record data much more fast like VFP98.
In my way,I use SQLFetchScroll(...SQL_FETCH_NEXT) to get and show record data one by one,It takes much more time!I want to make it fast,how can I do?
hi
|
|
|
|
|
You have to use some caching scheme. You simply can't store 500 million records from your table in RAM. Read records in the background thread to improve UI response time.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks!
I will try it,and then talk about it!
hi
|
|
|
|
|
But today I use SQL Server open the same .dbf(conver to .mdb),the SQL Server can not locate the last record in time.But VFP locate the last record in a few seconds.Somebody tell me than VFP use a special technology ,such as RUSHMORE.....
Who can tell me how about RUSHMORE?What is the relationship with the SQL?
hi
|
|
|
|
|
Does anyone know how to pass parameters into an sql command?
Either prompting or just straight in?
Sample code or KB would be very useful.
Thankyou verymuch
Richard.
|
|
|
|
|
what I know is you can difine a string variable as shown below
dim SqlSt as string
dim Db as ADODB.Connection
db= new ADODB.connection
Sqlst ="INSERT INTO TABLE1, Name VARCHAR(10),Surname, VARCHAR(1)"
db.execute slqst
|
|
|
|
|
Does anyone know how to pass parameters into an sql command?
Either prompting or just straight in?
Sample code or KB would be very useful.
Thankyou verymuch
Richard.
|
|
|
|
|
Hello,
I can't find an elegant solution for the following using ASP2.0 with MS SQL 7.0 SP2:
I would like to select the last 10 rows of a query without using RecordSet.MovePrevious nor using FETCH
anyone has an idea ?
Thanks,
Steven
|
|
|
|
|
if you have a key that can be used for a sort order (ORDER BY) then you can say something like:
SELECT TOP 10 whatever FROM whatever ORDER BY key DESC
it will give the first 10 items entered into the table, ie, the bottom 10 of the recordset
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Thanks Lauren,
I figured that out myself too
The problem is that I want the last ten rows displayed in ascending order without having to use RecordSet.Previous.
The recordset should contain the last ten rows (I know the value of last item in the table regarding to the query) in ascending order so I can display them using
while vRS.EOF = False Then
<display vrs.fields("value").value="">
vRs.MoveNext
...and I don't want to swim through a big recordset using FETCH...
any ideas ?
Thanks,
Steven
|
|
|
|
|
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!"
|
|
|
|