我的程序在运行时要经常的修改Connection对象的ConnectionString属性,但修改时总是提示"对象打开时不能操作"或"关闭时不能操作"的错误,请问应如何修改此属性才是正确的?
解决方案 »
- bitblt移动图片
- 程序运行几天后,出现运行时错误3343,不可识别的数据库格式'c:\history.mdb'
- 有关datareport的datamember问题
- 关于文件操作的问题!(好人啊,快来帮帮我这个初学者吧)
- 哪里有VB5下载呀?
- 高兴,软件发布了,欢迎下载使用,进来皆者有分!
- 读IP数据包的问题???
- 关于datagrid控件显示的字段自动排序问题,求教。。。
- 使用ADO时连接ACCESS数据库的问题
- 如何让 MSFlexGrid 或者 DBGrid 控件的列宽自动调整以显示所有内容?
- 能否用MSHFlexGrid定位Recordset的相应记录
- 怎样使Listview的每行背景色颜色不同。
DataEnvironment1.Connection1.Close
End If
DataEnvironment1.Connection1.ConnectionString = "Provider=SQLOLEDB.1;Password=sa;User ID=sa;Initial Catalog=Northwind;Data Source=PMSERVER"
DataEnvironment1.Connection1.Open
DataEnvironment1.Commands(1).CommandText = "select top 1 * from employees"
DataEnvironment1.Connection1.Close
End If
DataEnvironment1.Connection1.ConnectionString = "Provider=SQLOLEDB.1;Password=sa;User ID=sa;Initial Catalog=Northwind;Data Source=PMSERVER"
DataEnvironment1.Connection1.Open
DataEnvironment1.Commands(1).CommandText = "select top 1 * from employees"