|
Try disabling your virus scanning software.
----------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Good idea.
I used enditall to close most of the apps on the client side.
I disabled Norton on the client and server side.
Tried again and had the same result... 60 seconds
|
|
|
|
|
You got me on this one.
Could try returning more than one row (just to see how it works - slower, faster, just the same?)...
or, try starting mysql with the --quick switch.
Maybe run your app on a clean OS install.
I'm just grasping at straws - as I'm sure you have done yourself.
Sorry, I can't help.
----------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Is there something I'm missing on the setup of the server??
Anyone any ideas?
|
|
|
|
|
Hi again
I'm trying to connect to an access db using ADO
i use some sample codes to perform a simple SELECT query and display them through a recordset. I've tryed really hard to make it work i've searched everywhere pls help me find the problem.
This is the code i use::
<br />
<br />
<br />
#include <br />
#include <br />
#include <br />
<br />
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" \<br />
no_namespace rename("EOF", "EndOfFile")<br />
<br />
void main(int argc, char* argv[])<br />
{<br />
<br />
HRESULT hr = S_OK;<br />
_ConnectionPtr m_pConn;<br />
try<br />
{<br />
HRESULT hr = m_pConn.CreateInstance(__uuidof(Connection));<br />
if (FAILED( hr ))<br />
cout<<"Can't create an intance of ADO.Connection"<<endl;<br />
<br />
if (FAILED( m_pConn->Open(_bstr_t("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =ADOTestDB.MDB"),<br />
_bstr_t( "" ),<br />
_bstr_t( "" ), <br />
adModeUnknown )))<br />
<br />
cout<<"Can't open datasource"<<endl;<br />
<br />
<br />
_CommandPtr pCommand;<br />
pCommand.CreateInstance (__uuidof (Command));<br />
pCommand->ActiveConnection = m_pConn; <br />
pCommand->CommandText = "Select Name,Dept From Student";<br />
_RecordsetPtr pRecordset;<br />
pRecordset.CreateInstance (__uuidof (Recordset));<br />
pRecordset->CursorLocation = adUseClient;<br />
pRecordset->Open ( (IDispatch *) pCommand, vtMissing, adOpenStatic,<br />
adLockBatchOptimistic, adCmdUnknown);<br />
<br />
_bstr_t valField1;<br />
int valField2;<br />
pRecordset->MoveFirst();<br />
if (!pRecordset->EndOfFile)<br />
{<br />
while(!pRecordset->EndOfFile)<br />
{<br />
valField1 = pRecordset->Fields->GetItem("Name")->Value;<br />
valField2 = pRecordset->Fields->GetItem("Dept")->Value.intVal;<br />
printf("%d - %s\n",valField2,(LPCSTR)valField1);<br />
pRecordset->MoveNext();<br />
}<br />
}<br />
<br />
<br />
}catch( _com_error &ce )<br />
{<br />
printf("Error:%s\n",ce.Description);<br />
<br />
}<br />
m_pConn->Close();<br />
<br />
}<br />
i get an exeption
"Can't create an intance of ADO.Connection"
and the i asks if i want to debug
Pls help me i'm trying a lot to connect to a db and enything i do seems to be wrong
and the truth is that everytime i post a msg about C++ and ADO no one
replies.
pls i'm desparate
|
|
|
|
|
|
Hello Dear,
Please give me some good ADO Books name.
N.Rajakumar B.E.,
Application Developer,
www.newdreamz.tk
|
|
|
|
|
Hi ppl,
I have installed Server 2005 and when I try to run my application I get the following error mssg:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
Code:
Imports System.Data
Imports System.Data.SqlClient
Public Conn As SqlConnection = New SqlConnection
Dim da As New SqlDataAdapter
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Conn.ConnectionString = "Data Source=(local);" & _
"Initial Catalog=Rsch1;" & _
"Integrated Security=SSPI"
Conn.Open() ----------> Error Mssg
What could be the problem?
Tnx
|
|
|
|
|
try adding:
Imports System.Data.Sql
“Profanity is the attempt of a lazy and feeble mind to express itself forcefully”
|
|
|
|
|
hi, i need to compare two records of a table, the one with max date and the second highest one...so here need to somehow run a loop and trap the difference of each column and insert this diference in values in a hash table..
i can't get how to do this..could any one plz help me out here
thanx
|
|
|
|
|
deep7 wrote: i can't get how to do this..could any one plz help me out here
What aspect? The getting the rows out of the database? The looping over the columns? What? Since you asked in the SQL forum, I'm gussing that it is the getting stuff out of the database aspect.
To get the two rows in one result set use this:
SELECT TOP 2 *
FROM MyTable
ORDER BY [date] DESC
To get two result sets each with one row use this:
SELECT TOP 1 *
FROM MyTable
ORDER BY [date] DESC;
SELECT TOP 1 *
FROM MyTable
WHERE [date] NOT IN(SELECT MAX([date]) FROM MyTable)
ORDER BY [date] DESC;
Does this help?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Hi, thanks,
but i wanted to know how to compare these two record which i get...its like i have to store the diffrence suppose the 'amount' value is not same, then store this in a hash table...how to compare the two records (I have to check for all columns)
hope u understood..
thanks
|
|
|
|
|
Hi!
This query shows how to do that:
<br />
select e1.EmployeeID, e1.BirthDate, <br />
cast(e1.BirthDate-(<br />
select top 1 e2.BirthDate<br />
from HumanResources.Employee e2<br />
where e2.BirthDate<e1.BirthDate<br />
order by e2.BirthDate desc<br />
) as float)<br />
from HumanResources.Employee e1<br />
order by e1.BirthDate desc<br />
You can try it with SQL Server's AdventureWorks sample DB.
Rainer Stropek
Visit my blog at http://www.cubido.at/Blog/tabid/176/BlogID/4/Default.aspx
|
|
|
|
|
In sql server 2000, i have created tables using enterprise manager, how to convert it to sql stored procedure.
|
|
|
|
|
I think you have some things muddled some where. A table is a set of data made up of rows and columns. A stored procedure is code that you can execute to manipulate or retrieve data.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Did you mean how to get the scripts of created tables?
|
|
|
|
|
yes i wanted the sql script
|
|
|
|
|
In your
Enterprise manager - Tools Menu - Generate sql script or
right click table - All tasks - Generate sql script
|
|
|
|
|
|
im using ado in vc++ for access db
i have used this query but it shows
"data type mismatch in critria expressing"
SELECT * from FDetails where ddate = '05/29/2006'
ddate is datetime field
any one has solution for this problem
regards
Gan
|
|
|
|
|
I believe MSAccess uses pound signs to deliniate dates.
SELECT * from FDetails where ddate = #05/29/2006#
|
|
|
|
|
|
Hi there friends,
I have a pre-designed database and should work with that.
One of the columns of the table is DATETIME but just used for placing current time there.Every time I add just current time there the SQL SERVER adds date before that.
How can I just Fill current time there?
Best Regards -- Ali
|
|
|
|
|
Ignore the date portion or set it to fixed date. There is no Time data type in Sql Server.
|
|
|
|
|
Thanx buddy.
But Something surprizes me here. There are two applications in this system using this database seperatley. First One is in VB6 and uses ado.old and my application that is in C#.NET and using SqlDataAdapter,My records have Date And Time but their records Just have Time !!!
Any Ideas?
Kind Regards -- Ali
|
|
|
|