How to set Connection.CommandTimeout = 0

How to set Connection.CommandTimeout = 0
meciabAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.