|
u wrote:
You might want to check whether the Day and Month of the date in the database is stored correctly, i.e. 01/06/2004 is 1 June 2004 not 6 January 2004.
My reply:
I think and i checked it is 6th January 2004....
Well if u have a query that chk the records between range of dates n return all ,,plz send to me at
zahid_ash@hotmail.com
my querey is
SELECT * from Tab WHERE [Tab].[date] BETWEEN #25/01/1980# AND #1/10/1999#
but it return only one record..
Provided that Database is Access.
thanx
|
|
|
|
|
I think will it work ??
I m chking
SELECT *
FROM Tab
WHERE (((Tab.date) Between #1/25/1991# And #1/10/1992#));
I m confused with its # sign in Access ..ufffffff
|
|
|
|
|
But it is still showing me 1 record in VC++ front end.
but in Access it givs all records ..
i cant got it
|
|
|
|
|
I want to write a function in VC++ which will create a table(in a new mdb file) in MsAccess and also fill the table with values in the same function. As for creating the database i have to use msadox.dll and for populating database i have to use msado15.dll. But if i import both these dlls i get the following error.
< error C2011: 'DataTypeEnum' : 'enum' type redefinition >
This is probably due to DataTypeEnum being defined in both msadox.tlh and msado15.tlh.
Is there any way in which i can use both the dlls
or any other way i can create and populate the table in same function.
Note :(I got to create database in Access 2000)
With Regards,
Kaustubh
|
|
|
|
|
Couple of ways....simplest is to use namespaces
#import "msado15.dll" rename_namespace "ADONamespace"
#import "msadox.dll" rename_namespace "ADOXNamespace"
or
#import "msadox" exclude ("DataTypeEnum")
Remembering to do it only for one of them!
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
I am using sql server 7.0 in that i am having a table of 3 feild i.e.
empName, Logindate, HoursWorked
select * from tablename
Result:
empName LoginDate HoursWorked
------- ------------ ------------
Amit 06/03/04 13:44:45
Amit 06/04/04 14:44:45
now i want the sum of the field "HoursWorked"
Can any body help?
Actually im taking 'LoginTime' and 'LogoutTime' Datatype
'DateTime' from "login" table and subtraction of this two field is strored in field 'TimeDiffrence' datatype varchar
Query i m using is
"convert(varchar(8),(logoutTime-loginTime),14)Timediffrence"
now i want the sum of the field "Timediffrence"
|
|
|
|
|
try:
Select empName, Sum(Cast(HoursWorked as int))
From tablename
Group by empName
Or
Select empName, HoursWorked = Sum(DateDiff(ss, LoginTime, LogoutTime)) / 3600
From login
Group by empName
Wout Louwers
|
|
|
|
|
Thanks let me check it out
|
|
|
|
|
Hi
As almost a continuation of my last question, I'm now trying to select the latest date entry record for ALL products out of a table - the latest date varies for the products. I'm using a SELECT DISTINCT productID, but when I try to use MAX(date) it of course is choosing only those with literally the latest date....
Hope you can help again! I am learning..
Patrick Collins
Everything & Nothing
http://www.lostsheep.com
|
|
|
|
|
Try:
<br />
Select ProductID, Max(Date)<br />
Group by ProductID<br />
Wout Louwers
|
|
|
|
|
Thank you Wout,
How embarrassingly easy!
Just to check, if I select other fields for the product from that record, it has effectively limited them to the record with the Max Date for that product?
Thanks in advance
Patrick Collins
Everything & Nothing
http://www.lostsheep.com
|
|
|
|
|
No, the GROUP BY clause will only permit you to select the fields in the GROUP BY clause itself and any field in an aggregate function.
To do what you want you would have to create some sort of subquery
SELECT * FROM my_table
INNER JOIN
(SELECT product_id, MAX(date_field)
FROM my_table GROUP BY product_id)
AS inner_table
ON my_table.product_id = inner_table.product_id
This will allow you to return all the fields from your table.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Thanks again Colin,
Got there - It would have helped if any of the tables I was working with were normalized!
Patrick
Everything & Nothing
http://www.lostsheep.com
|
|
|
|
|
I'm currently using Enterprise Manager to connect to some SQL 2000 Servers to manage them. The problem is the Enterprise cannot connect with some servers but can with other servers, the error is: "SQL Server does not existe or access denied ConnectionOpen(Connect())". To verify the connection, I use Query Analyzer and it can connect all servers. (All connection library was enable for client and servers).
Please help me.
|
|
|
|
|
Would check that the registration properties are correct, and that they are using the default instance name (May be barking up the wrong tree however!)
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
It could be that your connection times out before it can connect to the SQL Server. Try a larger setting.
|
|
|
|
|
How to set timeout for SQL server check access rights ?
SQL server on remote computer either
connects very fast if succeeded,
but if user has no access right connects 10-30 seconds
and makes imression that application is hanged.
So question is:
how to decrease access rights time of check ?
Mostly needed to requrement to program it fast.
How such a problem is usually resolved in else ways ?
Asyncro connection works bad due to driver
not releases Connection.open() request fully,
but sends messages after it,
during that peiod application hangs.
Does that need full multi - threading programing?
Thanks.
|
|
|
|
|
Believe that one of the properties of the connection string is "ConnectionTimeout"
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I tried to set all connection properties
wit word "Timeout"
but for checking rights it os not works.
|
|
|
|
|
|
For check rights it is not working.
|
|
|
|
|
Can you clarify what you mean by access rights. When forming a connection string, you can specify a UserID / Password combination, if you set the connection timeout to a small value and then attempt to connect using a specified user account, then if the login is not found straight away (as seems to be the case from your original post), then the timeout will kick in and the connection attempt will be refused...
Can you give me a little more info please?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
When I connect to SQL server to which I has permission.
than I wait 20-30 secondes,
instead of 2-3 suffitient.
connection timeout not affects on this.
|
|
|
|
|
Hi,
I need to know the table structure of an MS-Access database. I tried Desc table sql and it doesnt seem to work. Is there any other method to know the structure of a table. I need to know it from VB/VC code and populate the result to a recordset.
Thanks for any help
Vikram Attiganal
|
|
|
|
|
Using ADO, you can call the Connection.OpenSchema method with the adSchemaTables flag. This returns a recordset with all the tables in. You can then iterate through this and call OpenSchema with asSchemaColumns and a table name specified.
Alternatively, you could use ADOX - this exposes a Catalog object, which if you give it an active connection object, holds an object model of the general structure
Catalog+
|
+
Tables+
|
+
Table+
|
+
Columns+
|
+
Column
To use ADOX, set a reference to ADO Ext. For DDL and Security
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|