• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 901
  • Last Modified:

How to set Connection.CommandTimeout = 0

How to set Connection.CommandTimeout = 0
0
meciab
Asked:
meciab
  • 7
  • 4
  • 2
  • +1
1 Solution
 
meciabAuthor Commented:
please don't pay attention to arbert comment
0
 
sw7104Commented:
     Set cnAdmin = CreateObject("ADODB.Connection")
            cnAdmin.Provider = "sqloledb.1"
            cnAdmin.Properties("Data Source").Value = sAdminServer
            cnAdmin.Properties("Initial Catalog").Value = sAdminDb
            cnAdmin.Properties("Integrated Security").Value = "SSPI"
            cnAdmin.Properties("Connect Timeout").Value = "1800"
            cnAdmin.CommandTimeout = 60*60
            cnAdmin.Open
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
sw7104Commented:
A bit more detail:

Dim sAdminServer, sAdminDb
sAdminServer = "[your target SQL Server]"
sAdminDb = "[your target DB]"

Set cnAdmin = CreateObject("ADODB.Connection")
            cnAdmin.Provider = "sqloledb.1"
            cnAdmin.Properties("Data Source").Value = sAdminServer
            cnAdmin.Properties("Initial Catalog").Value = sAdminDb
            cnAdmin.Properties("Integrated Security").Value = "SSPI"
            cnAdmin.Properties("Connect Timeout").Value = "1800"
            cnAdmin.CommandTimeout = 60*60
            cnAdmin.Open
0
 
Anthony PerkinsCommented:
For the record this is a duplicate question that goes beyond the allowed maximum permitted by EE.  Chances are it will be deleted by a moderator or the points reduced to comply with the EE Guidelines.
0
 
meciabAuthor Commented:
Please acperkins understand my questions. thanks (for the record)
0
 
meciabAuthor Commented:
Thanks sw7104 I can have access to the ("Connect Timeout") but the CommandTimeout is still set to 30 (instead of 60*60)
0
 
meciabAuthor Commented:
Ouppssss, sorry it works!
Thanks
but it's not set as default...
Do you know how o set default value for the command connection?
0
 
Anthony PerkinsCommented:
>>Do you know how o set default value for the command connection?<<
This is trivial, but since this is a different question I suggest you ask a new question.
0
 
meciabAuthor Commented:
I'm really touch by your intentions anthony (make me a smile my friend)
But this is just an additional question and only an optional answer is expected.
Thanks
0
 
Anthony PerkinsCommented:
>>But this is just an additional question and only an optional answer is expected.<<
Than I will opt out.

Good luck.
0
 
meciabAuthor Commented:
friendly intentions again... thx
0
 
Anthony PerkinsCommented:
You just don't have a clue, do you?

</unsubscribing>
0
 
meciabAuthor Commented:
you're to good to me anto
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 7
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now