|
Try using the ODBC timestamp format. It works in SQL server, and it should work for Access via ODBC/OLEDB. (I haven't tested it, though.)
SELECT
Count(1) As nMsg
FROM
Bacheca
WHERE
([Date] > {ts '2003-01-01 13:59:07'})
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Yep it works in SQL Server, but in Access it fails... he takes it as a GUID... BTW, this is my Access connection string, just in case... thanks for your effort anyway
adminDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("_private/db/skakkinostri.mdb")
Luca Leonardo Scorcia
http://zip.to/kojak (only in Italian)
|
|
|
|
|
How I can define that ADO Connection with MS SQL Server was failed before there are raised exceptions while ADO Command objects will run.
|
|
|
|
|
Whats your code and when does it happend?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I've an strange case where a second connection to a Sqlserver database hangs until time out has expired, the schema is below:
<br />
Connection1=New connection(database1)<br />
Connection1.Open<br />
Connection1.Begintrans<br />
...<br />
Connection2=New connection(database1)<br />
Connection2.Open<br />
Command2.Connection=Connection2<br />
Command2.ExecuteSelectionSQL |-----------------------here it hangs<br />
Connection2.Close<br />
.......<br />
Connection1.Commit<br />
Connection1.Close<br />
The first connection remains opened and in transaction while connection2 is opened with the same querystring, it opens correctly but when I issue a command using connection2 it hangs.
I use System.Data.SqlClient and I've tried different options in querystring (Enlist=false,.....) but I cannot solve the problem.
Thanks for your help,
Hzi.
|
|
|
|
|
seems like you have locking problems .. do you access the same tables ?
in both connections ?
|
|
|
|
|
Yes, when I'm accessing the same table, it hangs, but when I access another table it not hangs, but SQLServer locks a whole table when I insert a single record ?.
Thanks
|
|
|
|
|
No..
locking is not this simple..it differs according to how you access the table..
tell me the query so i can help !!
|
|
|
|
|
Here is a trace of the steps shown in sqltrace tool:
<br />
with the first connection<br />
exec sp_reset_connection<br />
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;BEGIN TRANSACTION<br />
sp_reset_connection<br />
update objectes set [Caducitat]=NULL, [DataValid]=NULL, [UltimaMod]=CONVERT(DATETIME, '2003-01-16T13:18:00', 126) where id=100225<br />
with the second connection<br />
sp_reset_connection<br />
select * from objectes where idref=''BAINtiA000046'' and IM1=1' <-------------It hangs here
It's all.
Thanks.
|
|
|
|
|
either make ur query serialised or change lock type
P.S. PATWAL
|
|
|
|
|
Using Open XML can I join fields in XML document to field in my database via in a stored procedure, perform a check, and return a dataset/XML?
Thanks
David
|
|
|
|
|
Hi developing my WEB application win ASP.NET (C#)
i got this error message in my browser
SELECT permission denied on object 'Contacts', database 'Contacts', owner
'dbo'.
this is the code where it stopped
Line 30: sqlDataAdapter1.Fill(dataSet11);
Line 31: //Update the data grid
Line 32: DataGrid1.DataBind();
Now i finally i grant the access to the database for user ASPNET but it
seems not working yet.
I am running MSDE (Sql Desktop engine)
so i am using osql dos command and scripts to grant the accesses
What i am missing ?????
Thanks
|
|
|
|
|
If you are logging into SQL Server with the ASPNET account you need to make sure that the login exists :
sp_helplogins
Verify that the ASPNET user account is created in the Contacts database
sp_helpuser
And that the uid of the ASPNET login is the same uid as the ASPNET user. (logins are to a server, users are to a database)
Then check the permission that the ASPNET user has against the table in question:
sp_helprotect
If you don't have sufficient permission, use the GRANT SELECT ON <object> TO <user>.
|
|
|
|
|
Is this possible... to determine the datatype of the column, in ACCESS database... like text/date/memo etc...
I was born intelligent Education ruined me!.
|
|
|
|
|
|
Mine is MS Access database
I was born intelligent Education ruined me!.
|
|
|
|
|
|
you could use ADOX which allows you to access an databases data definition language. I have some code which you could use, i'll post when i get into work.
"We don't understand the software, and sometimes we don't understand the hardware, but we can *see* the blinking lights!"
|
|
|
|
|
I use the .type to extrract the type of the field in the database. It works fine....
Thanks to.. the UTE[^].. where I got this idea
I was born intelligent Education ruined me!.
|
|
|
|
|
I have a query which returns a recordset for a statement which is displayed in ASP. It works very nicely - except for one thing. I suddenly noticed that although my
if rstDisplay.BOF or rstDisplay.EOF then - display error msg
else - display statement
works really well unless the firm has never had a single transaction (iow. if it has had transactions, just not within the current requested dates). The page then errors. After investigation I have found that it is because of fields sitting in the background which have been returned (eg. the firm name does exist in one of the tables, so that field is hiding in the background somewhere)
so the following returns:
Response.Write "state: " & rstDisplay.State -Displays "1"
Response.Write "count: " & rstDisplay.Fields.count -Displays "18"
so now I want to play with joins in query analyser. I am using @@rowcount to see how many rows are displayed, but don't know what to use to show the fields (like asp .fields.count). Can anyone enlighten me please?
Thanks
I knew it would end badly when I first met Chris in a Canberra alleyway and he said 'try some-it won't hurt you'... -Christian Graus on Code Project outages
His thoughts tumbled in his head, making and breaking alliances like underpants in a tumble dryer.
It hurt the way your tongue hurts after you accidentally staple it to he wall-Shaun Wilde
|
|
|
|
|
Megan,
If you are using Query Analyzer, it should show you the number of rows returned in the lower right hand corner without having to use rowcount. Under the results tab, there should be a boxes that show the following:
General Message, Server Name, User Name, Database, Execution Time, Number of Rows, and Caret Position
Additionally, if you want to see the @@Rowcount Variable in Query Analyzer, you mut declare a variable, set the variable = @@Rowcount and then print the variable.
<br />
DECLARE @myRows Int<br />
Select * from myTable<br />
Set @myRows = @@RowCount<br />
PRINT @myRows<br />
Hope this helps.
Jeremy
Jeremy Oldham
|
|
|
|
|
Hi,
Thanks - that's exactly the problem. The rowcount returned is 0. But if I click on the messages tab there appears to be an empty row there (I can go up to an empty line with my arrow keys). There is actually no row returned that meets my criteria, but info does exist that does meet some of the criteria, but not all (perhaps I should use a join instead of "and"?) and so the recordset is returned empty.
It's all very odd, but I'm probably just doing something silly.
Thanks again
I knew it would end badly when I first met Chris in a Canberra alleyway and he said 'try some-it won't hurt you'... -Christian Graus on Code Project outages
His thoughts tumbled in his head, making and breaking alliances like underpants in a tumble dryer.
It hurt the way your tongue hurts after you accidentally staple it to he wall-Shaun Wilde
|
|
|
|
|
Megan,
If you can show me your SQL, sample data in the table, and the result you expect, maybe I can help.
Let me know.
Jeremy
Jeremy Oldham
|
|
|
|
|
Hi,
Thanks for all the help - I've fixed the problem.
I knew it would end badly when I first met Chris in a Canberra alleyway and he said 'try some-it won't hurt you'... -Christian Graus on Code Project outages
His thoughts tumbled in his head, making and breaking alliances like underpants in a tumble dryer.
It hurt the way your tongue hurts after you accidentally staple it to he wall-Shaun Wilde
|
|
|
|
|
Megan,
When you run a query in QA here's what happens.
SQL Server sends back as part of the data stream, a header, data rows and the footer. The header contains the column information as to the number of columns, column names, and data types. The next section in the data stream is the actual row data and the footer contains the rowcount information.
So if you issued a query "SELECT * FROM authors WHERE 1=0" you would get a header with the column descriptions, no row data, and a footer that says "0 rows affected".
So when you are running your query, sql server is building the datastream and returning it to you but due to your join there are not any qualifying records, so you don't see any data.
|
|
|
|