VB 程序运行后提示:对象打开时,不允许操作。 15
PublicadoConAsNewADODB.Connection'定义一个数据连接Publicrs1AsNewADODB.RecordsetPublicFunction...
Public adoCon As New ADODB.Connection '定义一个数据连接Public rs1 As New ADODB.RecordsetPublic Function Cnn() As ADODB.Connection '定义函数 Set Cnn = New ADODB.Connection '返回一个数据库连接 Cnn.Open "Provider=SQLOLEDB.1;Password=853562;Persist Security Info=True;User ID=sa;Initial Catalog=hyzl01;Data Source=167.129.20.197"End FunctionPrivate Sub Form_Load()Adodc1.ConnectionString = Cnn'Adodc1.RecordSource = "select PRTypeId as 价格编号 ,prdisname as 价格名称 from xw_P_PriceType"Adodc1.RecordSource = "select a.pfullname as 商品全名,b.Unit1 as 单位,b.ordid as 单位排序, c.Price as 价格 from ptype as a,xw_PtypeUnit as b,xw_P_PtypePrice as c "If Cnn.State = 1 ThenCnn.CloseEnd IfAdodc1.RefreshSet MSHFlexGrid1.DataSource = Adodc1MSHFlexGrid1.Refresh
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询