If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > find if ACTIVE Connection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-03, 16:56
skalag skalag is offline
Registered User
 
Join Date: Mar 2003
Posts: 11
find if ACTIVE Connection

is ther any way to response.write on a page if there is abn active connection to database?
Reply With Quote
  #2 (permalink)  
Old 03-11-03, 05:09
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
can you clarify this please?
Reply With Quote
  #3 (permalink)  
Old 03-11-03, 07:57
skalag skalag is offline
Registered User
 
Join Date: Mar 2003
Posts: 11
i have put a 4 select options on one page in a frameset, populated therm from the datasbase and closed connection. But as i am a complete newbie at this and with so many select box and Connections i am confused, and i wanted to be able to check that the connection was not always 'open'.
Reply With Quote
  #4 (permalink)  
Old 03-11-03, 08:41
pjames pjames is offline
Registered User
 
Join Date: Jan 2003
Posts: 23
Hope This Helps

'Create RecordSet'''''''''''''''''''''''''''''''''''''''
Dim objRecordset
Set objRecordset = Server.CreateObject("ADODB.recordset")
objRecordset.ActiveConnection = strConnection ' = Your Connection String
objRecordset.CursorLocation = 3
objRecordset.LockType = 3
objRecordset.CursorType = 0
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''

'Open RecordSet''''''''''''''''''''''''''''''''''''''''' '
objRecordset.Source = strSQL '=Your Qurey
objRecordset.Open
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''

'Check if state is open And Close'''''''''''
'Enum Values
'0 The object is closed.
'1 The object is open.

If objRecordset.State = 1 Then objRecordset.close
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''
Reply With Quote
  #5 (permalink)  
Old 03-11-03, 10:00
skalag skalag is offline
Registered User
 
Join Date: Mar 2003
Posts: 11
Talking

thanks folks, that is perfect pjames. Thank you!
Reply With Quote
  #6 (permalink)  
Old 03-11-03, 12:30
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
remeber to set all your objects to nothing!
Code:
'close the rs
set rs=nothing
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On