By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,222 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,222 IT Pros & Developers. It's quick & easy.

ODBC Connection Timeout

P: n/a
After creating a routine to select from past ADODB connection strings, I

found that it takes 60 seconds to timeout! I found the Microsoft article

below

<http://support.microsoft.com/default.aspx?scid=kb;en-us;225859>

but wonder if anyone has a work around.

Nev
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
That is probably the default. You can use the ConnectionTimeout method of
the ADO connection object and set it to whatever you want.

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
After creating a routine to select from past ADODB connection strings, I

found that it takes 60 seconds to timeout! I found the Microsoft article

below

<http://support.microsoft.com/default.aspx?scid=kb;en-us;225859>

but wonder if anyone has a work around.

Nev

Nov 12 '05 #2

P: n/a
Thanks for your prompt reply.

I'm still a novice at this and wonder if I could ask for a sample line of
how to use the ConnectionTimeout method. My code is below.

Many thanks in anticipation

Nev

Public Function bolCheckODBCAttachment(ByVal pstrTable As String) As Boolean

' --------------------------------------------------------------------------
----

On Error GoTo Err_bolCheckODBCAttachment

bolCheckODBCAttachment = False

DoCmd.Hourglass True

'18/10/03 Code from:

'Microsoft Knowledge Base Article - 210319

'ACC2000: How to Trap ODBC Logon Error Messages
Dim dbs As DAO.Database

Dim qdf As DAO.QueryDef

Set dbs = CurrentDb()

Set qdf = dbs.CreateQueryDef("")

qdf.Connect = pstrTable
qdf.ReturnsRecords = False

qdf.sql = "SELECT * FROM tblOptions"

qdf.Execute

bolCheckODBCAttachment = True

Exit_bolCheckODBCAttachment:

DoCmd.Hourglass False

Exit Function

Err_bolCheckODBCAttachment:

bolCheckODBCAttachment = False

DoCmd.OpenForm "zsfrmAttach", , , , , A_DIALOG

GoTo Exit_bolCheckODBCAttachment

End Function

"James Lankford" <dr*********@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
That is probably the default. You can use the ConnectionTimeout method of
the ADO connection object and set it to whatever you want.

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
After creating a routine to select from past ADODB connection strings, I

found that it takes 60 seconds to timeout! I found the Microsoft article

below

<http://support.microsoft.com/default.aspx?scid=kb;en-us;225859>

but wonder if anyone has a work around.

Nev


Nov 12 '05 #3

P: n/a
Your code below is not using an ADO connection, rather it's using DAO. I
didn't see anywhere that you were attempting an ADO connection??

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
Thanks for your prompt reply.

I'm still a novice at this and wonder if I could ask for a sample line of
how to use the ConnectionTimeout method. My code is below.

Many thanks in anticipation

Nev

Public Function bolCheckODBCAttachment(ByVal pstrTable As String) As Boolean
' -------------------------------------------------------------------------- ----

On Error GoTo Err_bolCheckODBCAttachment

bolCheckODBCAttachment = False

DoCmd.Hourglass True

'18/10/03 Code from:

'Microsoft Knowledge Base Article - 210319

'ACC2000: How to Trap ODBC Logon Error Messages
Dim dbs As DAO.Database

Dim qdf As DAO.QueryDef

Set dbs = CurrentDb()

Set qdf = dbs.CreateQueryDef("")

qdf.Connect = pstrTable
qdf.ReturnsRecords = False

qdf.sql = "SELECT * FROM tblOptions"

qdf.Execute

bolCheckODBCAttachment = True

Exit_bolCheckODBCAttachment:

DoCmd.Hourglass False

Exit Function

Err_bolCheckODBCAttachment:

bolCheckODBCAttachment = False

DoCmd.OpenForm "zsfrmAttach", , , , , A_DIALOG

GoTo Exit_bolCheckODBCAttachment

End Function

"James Lankford" <dr*********@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
That is probably the default. You can use the ConnectionTimeout method of the ADO connection object and set it to whatever you want.

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
After creating a routine to select from past ADODB connection strings, I
found that it takes 60 seconds to timeout! I found the Microsoft article
below

<http://support.microsoft.com/default.aspx?scid=kb;en-us;225859>

but wonder if anyone has a work around.

Nev



Nov 12 '05 #4

P: n/a
James

Thankyou for putting me straight! Of course you are correct - the code I
pinched, initially creates an

ADO connection string, checks in ADO with a timeout of 3, then converts it
to a DAO string for the actual connection. I had stupidly returned the
whole routine to ADO thinking I was modernising it!!

I've now returned to the check in ADO with the timeout of 3, so that bit is
solved. Thankyou.

My front end is large and still has many DAO routines. If I try to link on
the ADO string, I receive the error:

3170: Could not find installable ISAM which, despite

http://support.microsoft.com/default...b;EN-US;155666

I don't really understand.

Should I persue the ADO connection??

Nev

"James Lankford" <dr*********@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
Your code below is not using an ADO connection, rather it's using DAO. I
didn't see anywhere that you were attempting an ADO connection??

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
Thanks for your prompt reply.

I'm still a novice at this and wonder if I could ask for a sample line of
how to use the ConnectionTimeout method. My code is below.

Many thanks in anticipation

Nev

Public Function bolCheckODBCAttachment(ByVal pstrTable As String) As Boolean

' --------------------------------------------------------------------------
----

On Error GoTo Err_bolCheckODBCAttachment

bolCheckODBCAttachment = False

DoCmd.Hourglass True

'18/10/03 Code from:

'Microsoft Knowledge Base Article - 210319

'ACC2000: How to Trap ODBC Logon Error Messages
Dim dbs As DAO.Database

Dim qdf As DAO.QueryDef

Set dbs = CurrentDb()

Set qdf = dbs.CreateQueryDef("")

qdf.Connect = pstrTable
qdf.ReturnsRecords = False

qdf.sql = "SELECT * FROM tblOptions"

qdf.Execute

bolCheckODBCAttachment = True

Exit_bolCheckODBCAttachment:

DoCmd.Hourglass False

Exit Function

Err_bolCheckODBCAttachment:

bolCheckODBCAttachment = False

DoCmd.OpenForm "zsfrmAttach", , , , , A_DIALOG

GoTo Exit_bolCheckODBCAttachment

End Function

"James Lankford" <dr*********@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
That is probably the default. You can use the ConnectionTimeout method

of the ADO connection object and set it to whatever you want.

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
> After creating a routine to select from past ADODB connection
strings, I >
> found that it takes 60 seconds to timeout! I found the Microsoft article >
> below
>
> <http://support.microsoft.com/default.aspx?scid=kb;en-us;225859>
>
> but wonder if anyone has a work around.
>
> Nev
>
>



Nov 12 '05 #5

P: n/a
You're opening an ADO connection then trying to convert it to DAO? Why would
you want to do that? I'm not sure if that can be done. I would recommended
one or the other, at least for a single procedure. I often use both ADO and
DAO in my applications, but I usually don't intermingle them within a single
procedure.

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
James

Thankyou for putting me straight! Of course you are correct - the code I
pinched, initially creates an

ADO connection string, checks in ADO with a timeout of 3, then converts it
to a DAO string for the actual connection. I had stupidly returned the
whole routine to ADO thinking I was modernising it!!

I've now returned to the check in ADO with the timeout of 3, so that bit is solved. Thankyou.

My front end is large and still has many DAO routines. If I try to link on the ADO string, I receive the error:

3170: Could not find installable ISAM which, despite

http://support.microsoft.com/default...b;EN-US;155666

I don't really understand.

Should I persue the ADO connection??

Nev

"James Lankford" <dr*********@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
Your code below is not using an ADO connection, rather it's using DAO. I
didn't see anywhere that you were attempting an ADO connection??

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
Thanks for your prompt reply.

I'm still a novice at this and wonder if I could ask for a sample line of how to use the ConnectionTimeout method. My code is below.

Many thanks in anticipation

Nev

Public Function bolCheckODBCAttachment(ByVal pstrTable As String) As

Boolean

' --------------------------------------------------------------------------
----

On Error GoTo Err_bolCheckODBCAttachment

bolCheckODBCAttachment = False

DoCmd.Hourglass True

'18/10/03 Code from:

'Microsoft Knowledge Base Article - 210319

'ACC2000: How to Trap ODBC Logon Error Messages
Dim dbs As DAO.Database

Dim qdf As DAO.QueryDef

Set dbs = CurrentDb()

Set qdf = dbs.CreateQueryDef("")

qdf.Connect = pstrTable
qdf.ReturnsRecords = False

qdf.sql = "SELECT * FROM tblOptions"

qdf.Execute

bolCheckODBCAttachment = True

Exit_bolCheckODBCAttachment:

DoCmd.Hourglass False

Exit Function

Err_bolCheckODBCAttachment:

bolCheckODBCAttachment = False

DoCmd.OpenForm "zsfrmAttach", , , , , A_DIALOG

GoTo Exit_bolCheckODBCAttachment

End Function

"James Lankford" <dr*********@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
> That is probably the default. You can use the ConnectionTimeout
method of
> the ADO connection object and set it to whatever you want.
>
> --
> James Lankford
>
>
> "Nifty" <ask@me ifyouwantknow.com> wrote in message
> news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
> > After creating a routine to select from past ADODB connection

strings,
I
> >
> > found that it takes 60 seconds to timeout! I found the Microsoft

article
> >
> > below
> >
> > <http://support.microsoft.com/default.aspx?scid=kb;en-us;225859>
> >
> > but wonder if anyone has a work around.
> >
> > Nev
> >
> >
>
>



Nov 12 '05 #6

P: n/a
Thanks again James

Sorry to be persitant but I have a situation where the server is often
unavailable.

The ADO connection is only used prior to the actual table connection routine
routine, to check whether Server and DB exist. This is used because a DAO
connection check has no timeout unavoidable system messages when the server
is not available. Am I correct in thinking there is no way to avoid this
intermingling?

I would prefer to use ADO throughout, but I'm not sure if that is wise when
there are quite few DAO routines still in the client file. What do you
think??

Nev

"James Lankford" <dragonzfang@_nospam_.hotmail.com> wrote in message
news:vq************@corp.supernews.com...
You're opening an ADO connection then trying to convert it to DAO? Why would you want to do that? I'm not sure if that can be done. I would recommended
one or the other, at least for a single procedure. I often use both ADO and DAO in my applications, but I usually don't intermingle them within a single procedure.

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
James

Thankyou for putting me straight! Of course you are correct - the code I
pinched, initially creates an

ADO connection string, checks in ADO with a timeout of 3, then converts it to a DAO string for the actual connection. I had stupidly returned the
whole routine to ADO thinking I was modernising it!!

I've now returned to the check in ADO with the timeout of 3, so that bit

is
solved. Thankyou.

My front end is large and still has many DAO routines. If I try to link

on
the ADO string, I receive the error:

3170: Could not find installable ISAM which, despite

http://support.microsoft.com/default...b;EN-US;155666

I don't really understand.

Should I persue the ADO connection??

Nev

"James Lankford" <dr*********@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
Your code below is not using an ADO connection, rather it's using DAO. I didn't see anywhere that you were attempting an ADO connection??

--
James Lankford
"Nifty" <ask@me ifyouwantknow.com> wrote in message
news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
> Thanks for your prompt reply.
>
> I'm still a novice at this and wonder if I could ask for a sample line
of
> how to use the ConnectionTimeout method. My code is below.
>
> Many thanks in anticipation
>
> Nev
>
>
>
>
>
> Public Function bolCheckODBCAttachment(ByVal pstrTable As String) As
Boolean
>
>

' -------------------------------------------------------------------------- > ----
>
> On Error GoTo Err_bolCheckODBCAttachment
>
> bolCheckODBCAttachment = False
>
> DoCmd.Hourglass True
>
> '18/10/03 Code from:
>
> 'Microsoft Knowledge Base Article - 210319
>
> 'ACC2000: How to Trap ODBC Logon Error Messages
>
>
> Dim dbs As DAO.Database
>
> Dim qdf As DAO.QueryDef
>
> Set dbs = CurrentDb()
>
> Set qdf = dbs.CreateQueryDef("")
>
> qdf.Connect = pstrTable
>
>
> qdf.ReturnsRecords = False
>
> qdf.sql = "SELECT * FROM tblOptions"
>
> qdf.Execute
>
> bolCheckODBCAttachment = True
>
> Exit_bolCheckODBCAttachment:
>
> DoCmd.Hourglass False
>
> Exit Function
>
> Err_bolCheckODBCAttachment:
>
> bolCheckODBCAttachment = False
>
> DoCmd.OpenForm "zsfrmAttach", , , , , A_DIALOG
>
> GoTo Exit_bolCheckODBCAttachment
>
> End Function
>
>
>
>
>
> "James Lankford" <dr*********@hotmail.com> wrote in message
> news:vp************@corp.supernews.com...
> > That is probably the default. You can use the ConnectionTimeout

method of
> > the ADO connection object and set it to whatever you want.
> >
> > --
> > James Lankford
> >
> >
> > "Nifty" <ask@me ifyouwantknow.com> wrote in message
> > news:3f********@isuwb1.itbcorpweb.det.nsw.edu.au.. .
> > > After creating a routine to select from past ADODB connection

strings,
I
> > >
> > > found that it takes 60 seconds to timeout! I found the Microsoft
article
> > >
> > > below
> > >
> > > <http://support.microsoft.com/default.aspx?scid=kb;en-us;225859>
> > >
> > > but wonder if anyone has a work around.
> > >
> > > Nev
> > >
> > >
> >
> >
>
>



Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.