| 发表于:2008-01-13 10:22:23 楼主 |
下面是我编写的程序,但是老是提示我con as adodb.connection用户类型未定义,请专家们指教!!! 然后我想把查询出来的结果显示出来,如何操作,请帮忙把代码写一下,谢谢!!!! private sub command1_click() dim con as adodb.connection set con = new adodb.connection dim rs as adodb.recordset set rs = new adodb.recordset con.commandtimeout = 0 con.open "provider=sqloledb.1;persist security info=true;initial catalog=webnmsdb;initial catalog=bam;data source=192.168.0.41", "sa", "" dim cx as string cx = inputbox("请输入要查询的逻辑/物理号码", "输入号码") if cx = "" or len(dn) <> 7 then msgbox "请输入正确电话号码" else yhzlcx_str = "select * from tbl_spdbchange where scallprefix= '" & cx & "'" rs.open yhzlcx_str, con, adopendynamic, adlockoptimistic if (rs.recordcount = 0) then msgbox "数据库中无记录" else end sub |
|
|
|
|