Home > Software engineering >  VB query SQL statements of a strange question!
VB query SQL statements of a strange question!

Time:10-14

Code:
Private Sub Form_Load ()
If rsMain Is Nothing Then Set rsMain=New ADODB. You
RsMain. Open the "Select a. *, b.M ingCheng from ecfBaoZhuangDiGao a left join ecfhuohao b on a.h uohao=b.h uohao", envEcf. CnnEcf, adOpenKeyset, adLockOptimistic
The Set grdmain. The DataSource=rsMain
The Set rsZZ=New ADODB. You
The Set rsXX=New ADODB. You
RsZZ. Open the "SELECT DaiMa code and GUIGE AS paper, ZhiZhiMing AS name FROM material_user. The dbo. EcmZhiZiDaiMa where PoUse=1 ORDER BY GUIGE", envEcf. CnnEcf, adOpenStatic, adLockReadOnly
RsXX. Open the "SELECT HNO AS box code, HNAME AS box name FROM material_user. The dbo. EcmZhiXiangLeiXing ORDER BY sihua DESC, HNAME", envEcf. CnnEcf, adOpenStatic, adLockReadOnly

End Sub
Question:
To execute sequentially rsmain. Can open, and then execute to rsZZ. The open and rsXX. Open to make mistakes.
In turn, will rsZZ. Open and rsXX. It's no problem for me to perform in front of the Open, perform rsmain. The Open is wrong.
Tips are the same error code:
The run time error 2147467259 (80004005) connection failure

Can know is that these statements execute can alone, but as they are now put together out of the question, and it is suddenly out of the question, always can perform before, and there is no modified..

Please expert help. Thank you very much!!!!!!!!!!

CodePudding user response:

If the code is no problem, isn't it a database?
  • Related