MSFlexGrid控件的DataSource属性怎么用啊?
MSFlexGrid控件的DataSource属性怎么用啊?能不能举个例子啊,用Access的数据库. 看看这段程序为什么有问题啊?(ADODC连接数据库)
Public Function myAdodcRecordSet(Optional ByVal MyTable As String = "HB589", Optional ByVal MyFields As String = "", Optional ByVal MySQLCondition1 As String = "", Optional ByVal MyDatabase As String = "HB.mdb") As Recordset<BR> <BR> Dim MyRs As ADODB.Recordset<BR> Dim myCnn As ADODB.Connection<BR> Dim MyConnectString As String<BR> Dim sql As String<BR> <BR> MsgBox GDesign<BR> MyConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & GDesignBin & "\" & MyDatabase & ";Persist Security Info=False"<BR> Set myCnn = New ADODB.Connection<BR> myCnn.Open MyConnectString<BR> <BR> ''建立RecordSet<BR> Set MyRs = New ADODB.Recordset<BR> sql = "SELECT " & MyFields & " FROM " & MyTable & MySQLCondition1<BR> MyRs.CursorLocation = adUseClient<BR> MyRs.LockType = adLockBatchOptimistic<BR> MyRs.CursorType = adOpenKeyset<BR> <BR> ''给函数赋值<BR> MyRs.Open sql, myCnn<BR> Set myAdodcRecordSet = MyRs<BR> <BR> Set myCnn = Nothing<BR> <BR> End Function<BR>
Private Sub UserForm_Initialize()
下面这一句报错.<BR> MSFG.DataSource = myAdodcRecordSet("HB589", "d,H")<BR>End Sub
而且我的程序里面全局字符串(AutoCAD启动时自动加载设置)开始有用,后来为空,这是什么原因啊? Open "hwq_setup.txt" For Input As #1
hwq_setup.txt文件与.dvb工程在同一个文件夹内,但系统告诉我找不到该文件,这是什么原因啊?
不知道怎么回事,我发不了新贴,只能写在一张贴子里面了,还望原谅啊。 不用全局字符串,切换VBAIDE时会自动清空的,GDesignBin变量可以用函数实现的 <P>雪山飞狐</P>
<P>你能否在这个位置,发个小的实例程序,谢谢.</P>
页:
[1]