Home > Software engineering >  Rookie consult warrior: vb6.0 by use connection sql2005 recordset recordcount problem
Rookie consult warrior: vb6.0 by use connection sql2005 recordset recordcount problem

Time:09-24

After the use adodc control link SQL database, using recordcount method can get a recordset article number, but in using the set rs=new adodb library. After you define a recordset variables, using rs. Recordcount method number record set to 1, ask ace, thank you, the program code is as follows:
1, use the adodc control code:
Adodc1. The ConnectionString=SQL_connstr
Adodc1. RecordSource="select distinct Station_Name from Station_Info"
Adodc1.Com mandType=adCmdText
Adodc1. Refresh
I=adodc1. You. Recordcount
At this point, I=1.
2, using rs variable code:
Set the rs=new adodb. You
Rs. Open the "select distinct Station_Name from Station_Info", SQL_conn, adOpenDynamic, adLockOptimistic, adCmdText
I=rs. Recordcount
At this point, I=1.
Can consult ace to explain why is such result, is to connect the same the same table in the database, query the same content,

CodePudding user response:

BBS in programming statements to answer you, you can go back to the programming BBS to see,
  • Related