December 7, 2004 at 2:34 am
Hi any help here would be greatfully received!
I am a running SQL2000 on a win2003 server online and need to get around the 30 second ODBC tiomeout error. Below is the code I am currently using to connect and query
set rs12 = Server.CreateObject("ADODB.Recordset")
rs12.ActiveConnection = "dsn=IMMDATA;uid=sa;"
rs12.Source = "SELECT COUNT (*) as mycount FROM [quick_count_b] " & Request("statementmain")
rs12.CursorType = 0
rs12.CursorLocation = 2
rs12.LockType = 3
rs12.Open()
rs12_numRows = 0
which works fine unless the query extends beyond 30 seconds running. now i'm sure there are other ways to connect to get around this problem but I can't seem to figure them out. If anyone could rewrite this for me I would be a very happy man!
Thankyou
December 7, 2004 at 4:57 am
rs12.ActiveConnection = "dsn=IMMDATA;uid=sa;"
and no password
did you test this ?
rs12.ActiveConnection.CommandTimeout = 45 'seconds
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
December 7, 2004 at 5:04 am
To add to this, I don't see a PWD argument, or am I missing something
What about having a look here: http://www.connectionstrings.com/
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
December 7, 2004 at 5:05 am
Hey, you've edited your post
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
December 7, 2004 at 5:11 am
yep, I noticed I'd forgotten to mention it
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
December 7, 2004 at 5:15 am
yep, I noticed I'd forgotten to mention it
btw we have just been hooked up to a new domain and now our internet connection's speed is improved by -10000
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
December 7, 2004 at 6:50 am
thanks, yes this is only a dev server and so there is no password. I can get the command to work if i simplify the query so it returns within 30 secs
December 7, 2004 at 6:57 am
thanks thats done the trick... it was the :
rs12.ActiveConnection.CommandTimeout = 45
line that made it happen where as before i had simply appended the COmmadTimeout to the connection vars like tis...
rs12.ActiveConnection = "dsn=IMMDATA;uid=sa;commandtimeout=300"
and it simply ignored it... thank you very much!
December 7, 2004 at 7:39 am
I'm glad it worked.
tip of the day : Avoid running with uid=sa in _any_ environment.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply