Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,457 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,887 people online right now. Registration is fast and FREE... Join Now!




record state

 
Reply to this topicStart new topic

record state

masipro
24 Jul, 2008 - 09:09 PM
Post #1

New D.I.C Head
*

Joined: 8 Jul, 2008
Posts: 39

Hi,

Please explaing what does 'State' refers in connection or recordset

CODE
If Cn.State = 1 Then Cn.Close
Cn.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=TAR;uid=admin;password=shoes"
Cn.Open



and
CODE

If rs.State = 1 Then rs.Close
rs.Open " select Tref from lea_consum ", Cn, adOpenStatic, adLockOptimistic

where rs=adodb.recordset

Regards
Masipro

User is offlineProfile CardPM
+Quote Post

BrainStew
RE: Record State
24 Jul, 2008 - 09:21 PM
Post #2

D.I.C Head
**

Joined: 2 Aug, 2007
Posts: 149



Thanked: 1 times
My Contributions
http://www.w3schools.com/ado/prop_rs_state.asp

The State property returns a value that describes if the object is open, closed, connecting, executing or retrieving data.

EDIT: so in your example it's checking if the rs is open, then close it before opening again (it will throw an error if you don't).

msdn and w3schools are your friend.

This post has been edited by BrainStew: 24 Jul, 2008 - 09:22 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 03:40PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month