How to set Connection.CommandTimeout = 0

How to set Connection.CommandTimeout = 0
meciabAsked:
Who is Participating?
 
sw7104Connect With a Mentor Commented:
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
 
meciabAuthor Commented:
please don't pay attention to arbert comment
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.